Skip to content

Commit

Permalink
tls: SSL_get_peer_certificate is deprecated (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers authored Nov 1, 2022
1 parent 54dd27f commit bd00ef2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tls/openssl/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,11 @@ int tls_peer_fingerprint(const struct tls_conn *tc, enum tls_fingerprint type,
if (!tc || !md)
return EINVAL;

#if OPENSSL_VERSION_MAJOR >= 3
cert = SSL_get1_peer_certificate(tc->ssl);
#else
cert = SSL_get_peer_certificate(tc->ssl);
#endif
if (!cert)
return ENOENT;

Expand Down Expand Up @@ -1064,7 +1068,11 @@ int tls_peer_common_name(const struct tls_conn *tc, char *cn, size_t size)
if (!tc || !cn || !size)
return EINVAL;

#if OPENSSL_VERSION_MAJOR >= 3
cert = SSL_get1_peer_certificate(tc->ssl);
#else
cert = SSL_get_peer_certificate(tc->ssl);
#endif
if (!cert)
return ENOENT;

Expand Down

0 comments on commit bd00ef2

Please sign in to comment.