--- tls.c 2014-12-08 14:10:28.000000000 -0500 +++ tls.c 2015-03-25 19:37:53.000000000 -0400 @@ -64,6 +64,6 @@ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -static SSL_CTX *CTX_Init _ANSI_ARGS_((State *statePtr, int proto, char *key, - char *cert, char *CAdir, char *CAfile, char *ciphers)); +static SSL_CTX *CTX_Init _ANSI_ARGS_((State *statePtr, int proto, const char *key, + const char *cert, const char *CAdir, const char *CAfile, const char *ciphers)); static int TlsLibInit _ANSI_ARGS_ (()) ; @@ -538,5 +538,5 @@ case TLS_SSL2: #if defined(NO_SSL2) - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, protocols[index], ": protocol not supported", NULL); return TCL_ERROR; #else @@ -545,5 +545,5 @@ case TLS_SSL3: #if defined(NO_SSL3) - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, protocols[index], ": protocol not supported", NULL); return TCL_ERROR; #else @@ -552,5 +552,5 @@ case TLS_TLS1: #if defined(NO_TLS1) - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, protocols[index], ": protocol not supported", NULL); return TCL_ERROR; #else @@ -559,5 +559,5 @@ case TLS_TLS1_1: #if defined(NO_TLS1_1) - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, protocols[index], ": protocol not supported", NULL); return TCL_ERROR; #else @@ -566,5 +566,5 @@ case TLS_TLS1_2: #if defined(NO_TLS1_2) - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, protocols[index], ": protocol not supported", NULL); return TCL_ERROR; #else @@ -575,10 +575,10 @@ } if (ctx == NULL) { - Tcl_AppendResult(interp, REASON(), (char *) NULL); + Tcl_AppendResult(interp, REASON(), NULL); return TCL_ERROR; } ssl = SSL_new(ctx); if (ssl == NULL) { - Tcl_AppendResult(interp, REASON(), (char *) NULL); + Tcl_AppendResult(interp, REASON(), NULL); SSL_CTX_free(ctx); return TCL_ERROR; @@ -747,6 +747,18 @@ #endif int tls1 = 1; - int tls1_1 = 1; - int tls1_2 = 1; + int tls1_1 = +#if defined(NO_TLS1_1) + 0 +#else + 1 +#endif + ; + int tls1_2 = +#if defined(NO_TLS1_2) + 0 +#else + 1 +#endif + ; int proto = 0; int verify = 0, require = 0, request = 1; @@ -1029,9 +1029,9 @@ State *statePtr; int proto; - char *key; - char *cert; - char *CAdir; - char *CAfile; - char *ciphers; + const char *key; + const char *cert; + const char *CAdir; + const char *CAfile; + const char *ciphers; { Tcl_Interp *interp = statePtr->interp; @@ -1050,5 +1050,5 @@ #if defined(NO_SSL2) if (ENABLED(proto, TLS_PROTO_SSL2)) { - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, "protocol SSL2 not supported", NULL); return (SSL_CTX *)0; } @@ -1056,5 +1056,5 @@ #if defined(NO_SSL3) if (ENABLED(proto, TLS_PROTO_SSL3)) { - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, "protocol SSL3 not supported", NULL); return (SSL_CTX *)0; } @@ -1062,5 +1062,5 @@ #if defined(NO_TLS1) if (ENABLED(proto, TLS_PROTO_TLS1)) { - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, "protocol TLS1 not supported", NULL); return (SSL_CTX *)0; } @@ -1068,5 +1068,5 @@ #if defined(NO_TLS1_1) if (ENABLED(proto, TLS_PROTO_TLS1_1)) { - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, "protocol TLS1.1 not supported", NULL); return (SSL_CTX *)0; } @@ -1074,5 +1074,5 @@ #if defined(NO_TLS1_2) if (ENABLED(proto, TLS_PROTO_TLS1_2)) { - Tcl_AppendResult(interp, "protocol not supported", NULL); + Tcl_AppendResult(interp, "protocol TLS1.2 not supported", NULL); return (SSL_CTX *)0; }