File build.with-openssl-1_1.patch of Package elinks

Index: elinks-0.12pre6/src/network/ssl/socket.c
===================================================================
--- elinks-0.12pre6.orig/src/network/ssl/socket.c
+++ elinks-0.12pre6/src/network/ssl/socket.c
@@ -67,7 +67,7 @@ static void
 ssl_set_no_tls(struct socket *socket)
 {
 #ifdef CONFIG_OPENSSL
-	((ssl_t *) socket->ssl)->options |= SSL_OP_NO_TLSv1;
+//nothing.. wut was that..
 #elif defined(CONFIG_GNUTLS)
 	{
 		/* GnuTLS does not support SSLv2 because it is "insecure".
@@ -145,7 +145,7 @@ ssl_connect(struct socket *socket)
 		}
 
 		if (client_cert) {
-			SSL_CTX *ctx = ((SSL *) socket->ssl)->ctx;
+			SSL_CTX *ctx = SSL_get_SSL_CTX(socket->ssl);
 
 			SSL_CTX_use_certificate_chain_file(ctx, client_cert);
 			SSL_CTX_use_PrivateKey_file(ctx, client_cert,
Index: elinks-0.12pre6/src/network/ssl/ssl.c
===================================================================
--- elinks-0.12pre6.orig/src/network/ssl/ssl.c
+++ elinks-0.12pre6/src/network/ssl/ssl.c
@@ -44,19 +44,13 @@ SSL_CTX *context = NULL;
 static void
 init_openssl(struct module *module)
 {
-	unsigned char f_randfile[PATH_MAX];
 
-	/* In a nutshell, on OS's without a /dev/urandom, the OpenSSL library
-	 * cannot initialize the PRNG and so every attempt to use SSL fails.
-	 * It's actually an OpenSSL FAQ, and according to them, it's up to the
-	 * application coders to seed the RNG. -- William Yodlowsky */
-	if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) {
-		/* Not an EGD, so read and write to it */
-		if (RAND_load_file(f_randfile, -1))
-			RAND_write_file(f_randfile);
-	}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+	SSL_library_init();
+#else
+	OPENSSL_init_ssl(0, NULL);
+#endif
 
-	SSLeay_add_ssl_algorithms();
 	context = SSL_CTX_new(SSLv23_client_method());
 	SSL_CTX_set_options(context, SSL_OP_ALL);
 	SSL_CTX_set_default_verify_paths(context);
openSUSE Build Service is sponsored by