mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:43:36 +03:00
cyassl: deal with lack of *get_peer_certificate
The function is only present in wolfssl/cyassl if it was built with --enable-opensslextra. With these checks added, pinning support is disabled unless the TLS lib has that function available. Also fix the mistake in configure that checks for the wrong lib name. Closes #566
This commit is contained in:
parent
1ff3a07be9
commit
151da51404
2 changed files with 14 additions and 3 deletions
|
|
@ -413,6 +413,8 @@ cyassl_connect_step2(struct connectdata *conn,
|
|||
}
|
||||
|
||||
if(data->set.str[STRING_SSL_PINNEDPUBLICKEY]) {
|
||||
#if defined(HAVE_WOLFSSL_GET_PEER_CERTIFICATE) || \
|
||||
defined(HAVE_CYASSL_GET_PEER_CERTIFICATE)
|
||||
X509 *x509;
|
||||
const char *x509_der;
|
||||
int x509_der_len;
|
||||
|
|
@ -449,6 +451,10 @@ cyassl_connect_step2(struct connectdata *conn,
|
|||
failf(data, "SSL: public key does not match pinned public key!");
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
failf(data, "Library lacks pinning support built-in");
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
#endif
|
||||
}
|
||||
|
||||
conssl->connecting_state = ssl_connect_3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue