summaryrefslogtreecommitdiff
path: root/ext/openssl/xp_ssl.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-01-08 00:39:53 +0100
committerAnatol Belski <ab@php.net>2017-01-08 00:39:53 +0100
commit97ac819c2b73ae57a971b6d0f719cd8b349ec098 (patch)
tree2332fcc7c9f47d450b7252373dfee8940e529170 /ext/openssl/xp_ssl.c
parent72038b6c381aa17c525fcb551b7c53f6a9d7b55e (diff)
parent43b92ed5a8d87d964acb4704ca683f241e645922 (diff)
downloadphp-git-97ac819c2b73ae57a971b6d0f719cd8b349ec098.tar.gz
Merge branch 'PHP-7.1'
* PHP-7.1: move various places to the centralized OpenSSL setup routine use the new API for opaque symbol in OpenSSL 1.1.x implement basic config support for OpenSSL 1.1.x
Diffstat (limited to 'ext/openssl/xp_ssl.c')
-rw-r--r--ext/openssl/xp_ssl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index fcbeed1133..9235aab61d 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -581,6 +581,11 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
{
PCCERT_CONTEXT cert_ctx = NULL;
PCCERT_CHAIN_CONTEXT cert_chain_ctx = NULL;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ X509 *cert = x509_store_ctx->cert;
+#else
+ X509 *cert = X509_STORE_CTX_get0_cert(x509_store_ctx);
+#endif
php_stream *stream;
php_openssl_netstream_data_t *sslsock;
@@ -595,7 +600,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
unsigned char *der_buf = NULL;
int der_len;
- der_len = i2d_X509(x509_store_ctx->cert, &der_buf);
+ der_len = i2d_X509(cert, &der_buf);
if (der_len < 0) {
unsigned long err_code, e;
char err_buf[512];
@@ -672,7 +677,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
int index, cert_name_utf8_len;
DWORD num_wchars;
- cert_name = X509_get_subject_name(x509_store_ctx->cert);
+ cert_name = X509_get_subject_name(cert);
index = X509_NAME_get_index_by_NID(cert_name, NID_commonName, -1);
if (index < 0) {
php_error_docref(NULL, E_WARNING, "Unable to locate certificate CN");