@@ -585,6 +585,11 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
585
585
{
586
586
PCCERT_CONTEXT cert_ctx = NULL ;
587
587
PCCERT_CHAIN_CONTEXT cert_chain_ctx = NULL ;
588
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
589
+ X509 * cert = x509_store_ctx -> cert ;
590
+ #else
591
+ X509 * cert = X509_STORE_CTX_get0_cert (x509_store_ctx );
592
+ #endif
588
593
589
594
php_stream * stream ;
590
595
php_openssl_netstream_data_t * sslsock ;
@@ -599,7 +604,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
599
604
unsigned char * der_buf = NULL ;
600
605
int der_len ;
601
606
602
- der_len = i2d_X509 (x509_store_ctx -> cert , & der_buf );
607
+ der_len = i2d_X509 (cert , & der_buf );
603
608
if (der_len < 0 ) {
604
609
unsigned long err_code , e ;
605
610
char err_buf [512 ];
@@ -676,7 +681,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
676
681
int index , cert_name_utf8_len ;
677
682
DWORD num_wchars ;
678
683
679
- cert_name = X509_get_subject_name (x509_store_ctx -> cert );
684
+ cert_name = X509_get_subject_name (cert );
680
685
index = X509_NAME_get_index_by_NID (cert_name , NID_commonName , -1 );
681
686
if (index < 0 ) {
682
687
php_error_docref (NULL , E_WARNING , "Unable to locate certificate CN" );
0 commit comments