Skip to content

Commit 7545948

Browse files
authored
Update README.md
more TLS testing code
1 parent 3f5f771 commit 7545948

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Proprietary, see the provided `license.md`.
2020
- TLS 1.2 capable versions of libcurl and OpenSSL (or its equivalent)
2121

2222
### TLS 1.2
23-
The Authorize.Net APIs only support connections using TLS 1.2. This PHP SDK communicates with the Authorize.Net API using `libcurl` and `OpenSSL` (or equivalent crypto library). It's important to make sure you have new enough versions of these components to support TLS 1.2. Additionally, it's very important to keep these components up to date going forward to mitigate the risk of any security flaws that may be discovered in these libraries.
23+
The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. This PHP SDK communicates with the Authorize.Net API using `libcurl` and `OpenSSL` (or equivalent crypto library). It's important to make sure you have new enough versions of these components to support TLS 1.2. Additionally, it's very important to keep these components up to date going forward to mitigate the risk of any security flaws that may be discovered in these libraries.
2424

2525
To test whether your current installation is capable of communicating to our servers using TLS 1.2, run the following PHP code and examine the output for the TLS version:
2626
```php
@@ -32,6 +32,18 @@ To test whether your current installation is capable of communicating to our ser
3232
curl_close($ch);
3333
```
3434

35+
If curl is unable to connect to our URL (as given in the previous sample), it's likely that your system is not able to connect using TLS 1.2, or does not have a supported cipher installed. To verify what TLS version your connection does support, run the following PHP code:
36+
```php
37+
<?php
38+
$ch = curl_init('https://www.howsmyssl.com/a/check');
39+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
40+
$data = curl_exec($ch);
41+
curl_close($ch);
42+
43+
$json = json_decode($data);
44+
echo "Connection uses " . $json->tls_version ."\n";
45+
```
46+
3547

3648
## Autoloading
3749
We recommend using [`Composer`](http://getcomposer.org) *(note we never recommend you

0 commit comments

Comments
 (0)