Fix example code to match sequence shown in OpenSSL man page.

This commit is contained in:
Christopher Kohlhoff 2011-03-21 10:36:58 +11:00
parent 7cbd3f65e1
commit 13cc97283b
2 changed files with 10 additions and 6 deletions

View File

@ -141,10 +141,12 @@ public:
*
* // ... establish connection and perform handshake ...
*
* if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK)
* if (X509* cert = SSL_get_peer_certificate(sock.native_handle()))
* {
* X509* cert = SSL_get_peer_certificate(sock.native_handle());
* // ...
* if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK)
* {
* // ...
* }
* }
* @endcode
*/

View File

@ -83936,10 +83936,12 @@ The `native_handle()` function returns a pointer of type `SSL*` that is suitable
// ... establish connection and perform handshake ...
if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK)
if (X509* cert = SSL_get_peer_certificate(sock.native_handle()))
{
X509* cert = SSL_get_peer_certificate(sock.native_handle());
// ...
if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK)
{
// ...
}
}