diff options
author | Wez Furlong <wez@php.net> | 2002-08-11 11:25:24 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-08-11 11:25:24 +0000 |
commit | 94be838dc1db1e0c0fd65dba48abd37efbf24317 (patch) | |
tree | 4bfb26b1561b77c5ef247a655f0844e61c04df9a | |
parent | 5a21ab42cb0a7b4d0bc5661a6ae7d6ac085ed800 (diff) | |
download | php-git-94be838dc1db1e0c0fd65dba48abd37efbf24317.tar.gz |
More verbosity when activating SSL on a socket fails.
-rw-r--r-- | main/network.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main/network.c b/main/network.c index 7255abb6d2..a42f18e854 100644 --- a/main/network.c +++ b/main/network.c @@ -581,19 +581,24 @@ PHPAPI int php_stream_sock_ssl_activate_with_method(php_stream *stream, int acti php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; SSL_CTX *ctx = NULL; - if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET)) + if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: stream is not a network stream"); return FAILURE; + } if (activate == sock->ssl_active) return SUCCESS; /* already in desired mode */ if (activate && sock->ssl_handle == NULL) { ctx = SSL_CTX_new(method); - if (ctx == NULL) + if (ctx == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: failed to create an SSL context"); return FAILURE; + } sock->ssl_handle = SSL_new(ctx); if (sock->ssl_handle == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: failed to create an SSL handle"); SSL_CTX_free(ctx); return FAILURE; } @@ -603,6 +608,7 @@ PHPAPI int php_stream_sock_ssl_activate_with_method(php_stream *stream, int acti if (activate) { if (SSL_connect(sock->ssl_handle) <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: SSL handshake/connection failed"); SSL_shutdown(sock->ssl_handle); return FAILURE; } |