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,11 +141,13 @@ public:
*
* // ... establish connection and perform handshake ...
*
* if (X509* cert = SSL_get_peer_certificate(sock.native_handle()))
* {
* if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK)
* {
* X509* cert = SSL_get_peer_certificate(sock.native_handle());
* // ...
* }
* }
* @endcode
*/
native_handle_type native_handle()

View File

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