]> granicus.if.org Git - php/commitdiff
Merge branch 'updated_tls_support' of https://github.com/rdlowrey/php-src
authorMichael Wallner <mike@php.net>
Thu, 17 Oct 2013 13:27:15 +0000 (15:27 +0200)
committerMichael Wallner <mike@php.net>
Thu, 17 Oct 2013 13:27:15 +0000 (15:27 +0200)
* 'updated_tls_support' of https://github.com/rdlowrey/php-src:
  Added support for TLSv1.1 and TLSv1.2

Conflicts:
ext/openssl/xp_ssl.c

1  2 
ext/openssl/openssl.c
ext/openssl/xp_ssl.c

Simple merge
index 914a4818825f2ab1d6ba49ed435b3bfb987606d4,9154a03773a2c82c1a57f6b29a9fdba6ba0dcc81..2e7f0cdc3f676e967a2655fb23f5c2091b6db9e8
@@@ -853,8 -895,33 +895,32 @@@ php_stream_ops php_openssl_socket_ops 
        php_openssl_sockop_set_option,
  };
  
- static char * get_sni(php_stream_context *ctx, char *resourcename, long resourcenamelen, int is_persistent TSRMLS_DC) {
+ static int get_crypto_method(php_stream_context *ctx) {
+         if (ctx) {
+                 zval **val = NULL;
+                 long crypto_method;
+                 if (php_stream_context_get_option(ctx, "ssl", "crypto_method", &val) == SUCCESS) {
+                         convert_to_long_ex(val);
+                         crypto_method = (long)Z_LVAL_PP(val);
+                         switch (crypto_method) {
+                                 case STREAM_CRYPTO_METHOD_SSLv2_CLIENT:
+                                 case STREAM_CRYPTO_METHOD_SSLv3_CLIENT:
+                                 case STREAM_CRYPTO_METHOD_SSLv23_CLIENT:
+                                 case STREAM_CRYPTO_METHOD_TLS_CLIENT:
+                                 case STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT:
+                                 case STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT:
+                                         return crypto_method;
+                         }
+                 }
+         }
+         return STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
+ }
  
 -
+ static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t resourcenamelen, int is_persistent TSRMLS_DC) {
        php_url *url;
  
        if (ctx) {