You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2015/11/02 15:32:42 UTC

Re: svn commit: r1711667 - in /tomcat/native/trunk/native: ./ src/sslcontext.c

Mark,

On 10/31/15 2:57 PM, markt@apache.org wrote:
> Author: markt
> Date: Sat Oct 31 18:57:58 2015
> New Revision: 1711667
> 
> URL: http://svn.apache.org/viewvc?rev=1711667&view=rev
> Log:
> Update ignores
> 
> Modified:
>     tomcat/native/trunk/native/   (props changed)
>     tomcat/native/trunk/native/src/sslcontext.c
> 
> Propchange: tomcat/native/trunk/native/
> ------------------------------------------------------------------------------
> --- svn:ignore (added)
> +++ svn:ignore Sat Oct 31 18:57:58 2015
> @@ -0,0 +1,9 @@
> +.make.dirs
> +Makefile
> +build-outputs.mk
> +config.log
> +config.nice
> +config.status
> +configure
> +tcnative.pc
> +tcnative.spec
> 
> Modified: tomcat/native/trunk/native/src/sslcontext.c
> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/sslcontext.c?rev=1711667&r1=1711666&r2=1711667&view=diff
> ==============================================================================
> --- tomcat/native/trunk/native/src/sslcontext.c (original)
> +++ tomcat/native/trunk/native/src/sslcontext.c Sat Oct 31 18:57:58 2015
> @@ -106,12 +106,14 @@ int ssl_callback_ServerNameIndication(SS
>      hostname = (*env)->NewStringUTF(env, servername);
>      original_ssl_context = P2J(c->ctx);
>  
> -    // Make the call
> -    new_ssl_context = (*env)->CallStaticLongMethod(env,
> -                                                            ssl_context_class,
> -                                                            sni_java_callback,
> -                                                            original_ssl_context,
> -                                                            hostname);
> +    // Make the call only if the statis methos exists
> +    if (sni_java_callback != 0) {
> +        new_ssl_context = (*env)->CallStaticLongMethod(env,
> +                                                       ssl_context_class,
> +                                                       sni_java_callback,
> +                                                       original_ssl_context,
> +                                                       hostname);
> +    }
>  
>      if (original_ssl_context != new_ssl_context) {
>          SSL_set_SSL_CTX(ssl, J2P(new_ssl_context, SSL_CTX *));
> @@ -283,6 +285,10 @@ TCN_IMPLEMENT_CALL(jlong, SSLContext, ma
>          ssl_context_class = (*e)->NewGlobalRef(e, o);
>          sni_java_callback = (*e)->GetStaticMethodID(e, ssl_context_class,
>                                                      "sniCallBack", "(JLjava/lang/String;)J");
> +        /* Older Tomcat versions may not have this static method */
> +        if ( JNI_TRUE == (*e)->ExceptionCheck(e) ) {
> +            (*e)->ExceptionClear(e);
> +        }
>      }
>  
>      /* Set up OpenSSL call back if SNI is provided by the client */

This commit looks to be more extensive than the commit comment would
suggest.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1711667 - in /tomcat/native/trunk/native: ./ src/sslcontext.c

Posted by Mark Thomas <ma...@apache.org>.
On 02/11/2015 14:32, Christopher Schultz wrote:
> Mark,
> 
> On 10/31/15 2:57 PM, markt@apache.org wrote:
>> Author: markt
>> Date: Sat Oct 31 18:57:58 2015
>> New Revision: 1711667
>>
>> URL: http://svn.apache.org/viewvc?rev=1711667&view=rev
>> Log:
>> Update ignores
>>
>> Modified:
>>     tomcat/native/trunk/native/   (props changed)
>>     tomcat/native/trunk/native/src/sslcontext.c
>>
>> Propchange: tomcat/native/trunk/native/
>> ------------------------------------------------------------------------------
>> --- svn:ignore (added)
>> +++ svn:ignore Sat Oct 31 18:57:58 2015
>> @@ -0,0 +1,9 @@
>> +.make.dirs
>> +Makefile
>> +build-outputs.mk
>> +config.log
>> +config.nice
>> +config.status
>> +configure
>> +tcnative.pc
>> +tcnative.spec
>>
>> Modified: tomcat/native/trunk/native/src/sslcontext.c
>> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/sslcontext.c?rev=1711667&r1=1711666&r2=1711667&view=diff
>> ==============================================================================
>> --- tomcat/native/trunk/native/src/sslcontext.c (original)
>> +++ tomcat/native/trunk/native/src/sslcontext.c Sat Oct 31 18:57:58 2015
>> @@ -106,12 +106,14 @@ int ssl_callback_ServerNameIndication(SS
>>      hostname = (*env)->NewStringUTF(env, servername);
>>      original_ssl_context = P2J(c->ctx);
>>  
>> -    // Make the call
>> -    new_ssl_context = (*env)->CallStaticLongMethod(env,
>> -                                                            ssl_context_class,
>> -                                                            sni_java_callback,
>> -                                                            original_ssl_context,
>> -                                                            hostname);
>> +    // Make the call only if the statis methos exists
>> +    if (sni_java_callback != 0) {
>> +        new_ssl_context = (*env)->CallStaticLongMethod(env,
>> +                                                       ssl_context_class,
>> +                                                       sni_java_callback,
>> +                                                       original_ssl_context,
>> +                                                       hostname);
>> +    }
>>  
>>      if (original_ssl_context != new_ssl_context) {
>>          SSL_set_SSL_CTX(ssl, J2P(new_ssl_context, SSL_CTX *));
>> @@ -283,6 +285,10 @@ TCN_IMPLEMENT_CALL(jlong, SSLContext, ma
>>          ssl_context_class = (*e)->NewGlobalRef(e, o);
>>          sni_java_callback = (*e)->GetStaticMethodID(e, ssl_context_class,
>>                                                      "sniCallBack", "(JLjava/lang/String;)J");
>> +        /* Older Tomcat versions may not have this static method */
>> +        if ( JNI_TRUE == (*e)->ExceptionCheck(e) ) {
>> +            (*e)->ExceptionClear(e);
>> +        }
>>      }
>>  
>>      /* Set up OpenSSL call back if SNI is provided by the client */
> 
> This commit looks to be more extensive than the commit comment would
> suggest.

If you look a little further up/down your inbox you'll see I corrected
the comment.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org