From 9e985ffd12cacf5ca35c1d9a65623b9221510239 Mon Sep 17 00:00:00 2001 From: Dejan Levec Date: Thu, 10 Oct 2019 11:00:34 +0200 Subject: [PATCH] Don't verify TLS peer. --- library.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library.c b/library.c index 8921c0fb9f..fe774895cb 100644 --- a/library.c +++ b/library.c @@ -1875,10 +1875,18 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock) tv_ptr = &tv; } + php_stream_context *context = php_stream_context_alloc(); + + zval verify_peer_zval; + ZVAL_BOOL(&verify_peer_zval, 0); + + php_stream_context_set_option(context, "ssl", "verify_peer", &verify_peer_zval); + php_stream_context_set_option(context, "ssl", "verify_peer_name", &verify_peer_zval); + redis_sock->stream = php_stream_xport_create(host, host_len, 0, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, persistent_id ? ZSTR_VAL(persistent_id) : NULL, - tv_ptr, NULL, &estr, &err); + tv_ptr, context, &estr, &err); if (persistent_id) { zend_string_release(persistent_id);