summaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_sock2.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bio/b_sock2.c')
-rw-r--r--crypto/bio/b_sock2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/bio/b_sock2.c b/crypto/bio/b_sock2.c
index 942825a8e0..df13d58c71 100644
--- a/crypto/bio/b_sock2.c
+++ b/crypto/bio/b_sock2.c
@@ -12,6 +12,7 @@
#include <errno.h>
#include "bio_local.h"
+#include "internal/ktls.h"
#include <openssl/err.h>
@@ -51,6 +52,17 @@ int BIO_socket(int domain, int socktype, int protocol, int options)
BIOerr(BIO_F_BIO_SOCKET, BIO_R_UNABLE_TO_CREATE_SOCKET);
return INVALID_SOCKET;
}
+# ifndef OPENSSL_NO_KTLS
+ {
+ /*
+ * The new socket is created successfully regardless of ktls_enable.
+ * ktls_enable doesn't change any functionality of the socket, except
+ * changing the setsockopt to enable the processing of ktls_start.
+ * Thus, it is not a problem to call it for non-TLS sockets.
+ */
+ ktls_enable(sock);
+ }
+# endif
return sock;
}