Description: fix bug 0002807: error: 'X509_V_ERR_HOSTNAME_MISMATCH' undeclared
Author: PICCORO Lenz McKAY <mckaygerhard@gmail.com>
Origin: other, https://bugs.netsurf-browser.org/mantis/view.php?id=2807
Bug: https://bugs.netsurf-browser.org/mantis/view.php?id=2807

--- netsurf-3.10.orig/netsurf/content/fetchers/curl.c
+++ netsurf-3.10/netsurf/content/fetchers/curl.c
@@ -645,10 +645,11 @@ fetch_curl_store_certs_in_cache(struct c
 			chain.certs[depth].err = SSL_CERT_ERR_REVOKED;
 			break;
 
+#if OPENSSL_VERSION_NUMBER > 0x10100000L
 		case X509_V_ERR_HOSTNAME_MISMATCH:
 			chain.certs[depth].err = SSL_CERT_ERR_HOSTNAME_MISMATCH;
 			break;
-
+#endif
 		default:
 			chain.certs[depth].err = SSL_CERT_ERR_UNKNOWN;
 			break;
@@ -766,6 +767,7 @@ static int fetch_curl_cert_verify_callba
 {
 	struct curl_fetch_info *f = (struct curl_fetch_info *) parm;
 	int ok;
+#if OPENSSL_VERSION_NUMBER > 0x10100000L
 	X509_VERIFY_PARAM *vparam;
 
 	/* Configure the verification parameters to include hostname */
@@ -780,7 +782,9 @@ static int fetch_curl_cert_verify_callba
 	if (ok) {
 		ok = X509_STORE_CTX_set_app_data(x509_ctx, parm);
 	}
-
+#else
+	ok = X509_STORE_CTX_set_app_data(x509_ctx, parm);
+#endif
 	/* verify the certificate chain using standard call */
 	if (ok) {
 		ok = X509_verify_cert(x509_ctx);
