add additional checks + cleanup
[oweals/openssl.git] / apps / s_client.c
index 181cb3f15b19868392917cf5600fe3ef86fcd1c3..50e27a07328d0038de6593ed508a5155d5aa2baa 100644 (file)
@@ -239,13 +239,13 @@ typedef struct tlsextctx_st {
 static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg)
        {
        tlsextctx * p = (tlsextctx *) arg;
-       const unsigned char * hn= SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
+       const char * hn= SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
        if (SSL_get_servername_type(s) != -1) 
                p->ack = !SSL_session_reused(s) && hn != NULL;
        else 
                BIO_printf(bio_err,"Can't use SSL_get_servername\n");
        
-       return SSL_ERROR_NONE;
+       return SSL_TLSEXT_ERR_OK;
        }
 #endif
 
@@ -647,7 +647,7 @@ bad:
 #ifndef OPENSSL_NO_TLSEXT
        if (servername != NULL)
                {
-               if (!SSL_set_tlsext_hostname(con,servername))
+               if (!SSL_set_tlsext_host_name(con,servername))
                        {
                        BIO_printf(bio_err,"Unable to set TLS servername extension.\n");
                        ERR_print_errors(bio_err);