Update tunala so it builds ok with OPENSSL_NO_DEPRECATED, and improve the
[openssl.git] / demos / bio / sconnect.c
index 8a667f5911781ea5ee3ef796f10f050cd0869327..880344eb78453b80b3c87a5c357b2b1114a82d77 100644 (file)
@@ -9,8 +9,9 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
-#include "err.h"
-#include "ssl.h"
+#include <unistd.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
 
 extern int errno;
 
@@ -31,11 +32,16 @@ char *argv[];
        else
                host=argv[1];
 
+#ifdef WATT32
+       dbug_init();
+       sock_init();
+#endif
+
        /* Lets get nice error messages */
        SSL_load_error_strings();
 
        /* Setup all the global SSL stuff */
-       SSLeay_add_ssl_algorithms();
+       OpenSSL_add_ssl_algorithms();
        ssl_ctx=SSL_CTX_new(SSLv23_client_method());
 
        /* Lets make a SSL structure */
@@ -48,7 +54,7 @@ char *argv[];
 
        /* Lets use a connect BIO under the SSL BIO */
        out=BIO_new(BIO_s_connect());
-       BIO_set_hostname(out,host);
+       BIO_set_conn_hostname(out,host);
        BIO_set_nbio(out,1);
        out=BIO_push(ssl_bio,out);