You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sslscan.c
+103Lines changed: 103 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4962,6 +4962,109 @@ unsigned int checkIfTLSVersionIsSupported(struct sslCheckOptions *options, unsig
4962
4962
bs_free(&tls_extensions);
4963
4963
bs_free(&client_hello);
4964
4964
bs_free(&server_hello);
4965
+
4966
+
/* If we're about to return false, let's make one last attempt using OpenSSL's built-in functions to test the protocol. Some non-standard TLS stacks don't like our ClientHello because it includes "too many" ciphersuite options (even though it is perfectly valid per the specs). */
/* Makes a fallback attempt to check if a TLS version is supported. Uses OpenSSL's functions instead of building our own ClientHello. Useful in odd cases where non-standard TLS stacks reject our valid ClientHellos. */
printf_verbose("Using fallback method for checking if %s is supported.\n", getPrintableTLSName(tls_version));
5001
+
5002
+
/* Connect to the target host. */
5003
+
intsocketDescriptor=tcpConnect(options);
5004
+
if (socketDescriptor==0) {
5005
+
printf_verbose("%s: failed to connect to target.\n", __func__);
5006
+
goto done;
5007
+
}
5008
+
5009
+
/* Create a new context. */
5010
+
options->ctx=new_CTX(sslMethod);
5011
+
if (options->ctx==NULL) {
5012
+
printf_verbose("%s: failed to create context.\n", __func__);
5013
+
goto done;
5014
+
}
5015
+
5016
+
/* Set the minimum and maximum protocol versions to the same thing. This ensures that if we connect, we're only connected with this exact TLS version. */
5017
+
if (!SSL_CTX_set_min_proto_version(options->ctx, version)) {
5018
+
printf_verbose("%s: failed to set minimum protocol version.\n", __func__);
5019
+
goto done;
5020
+
}
5021
+
5022
+
if (!SSL_CTX_set_max_proto_version(options->ctx, version)) {
5023
+
printf_verbose("%s: failed to set maximum protocol version.\n", __func__);
5024
+
goto done;
5025
+
}
5026
+
5027
+
/* Set the ciphersuite string in the context. */
5028
+
if (!setCipherSuite(options, sslMethod, options->cipherstring)) {
5029
+
printf_verbose("%s: failed to set the ciphersuite list: [%s]\n", __func__, options->cipherstring);
5030
+
goto done;
5031
+
}
5032
+
5033
+
/* Create the SSL object. */
5034
+
SSL*ssl=new_SSL(options->ctx);
5035
+
if (ssl==NULL) {
5036
+
printf_verbose("%s: failed to create SSL object.\n", __func__);
5037
+
goto done;
5038
+
}
5039
+
5040
+
/* Set the SNI. */
5041
+
if (!SSL_set_tlsext_host_name(ssl, options->sniname)) {
5042
+
printf_verbose("%s: failed to set SNI.\n", __func__);
0 commit comments