diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index e367fbd..efaaf23 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -6235,12 +6235,6 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl,
         MBEDTLS_SSL_DEBUG_MSG( 1, ( "There is pending outgoing data" ) );
         return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
     }
-    /* Protocol must be DLTS, not TLS */
-    if( ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM )
-    {
-        MBEDTLS_SSL_DEBUG_MSG( 1, ( "Only DTLS is supported" ) );
-        return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
-    }
     /* Version must be 1.2 */
     if( ssl->major_ver != MBEDTLS_SSL_MAJOR_VERSION_3 )
     {
@@ -6330,6 +6324,15 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl,
     /*
      * Saved fields from top-level ssl_context structure
      */
+#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1) || defined(MBEDTLS_SSL_PROTO_TLS1_2)
+    used += 8;
+    if( used <= buf_len )
+    {
+        memcpy( p, ssl->in_ctr, 8 );
+        p += 8;
+    }
+#endif
+
 #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
     used += 4;
     if( used <= buf_len )
@@ -6475,8 +6478,7 @@ static int ssl_context_load( mbedtls_ssl_context *ssl,
      * We can't check that the config matches the initial one, but we can at
      * least check it matches the requirements for serializing.
      */
-    if( ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM ||
-        ssl->conf->max_major_ver < MBEDTLS_SSL_MAJOR_VERSION_3 ||
+    if( ssl->conf->max_major_ver < MBEDTLS_SSL_MAJOR_VERSION_3 ||
         ssl->conf->min_major_ver > MBEDTLS_SSL_MAJOR_VERSION_3 ||
         ssl->conf->max_minor_ver < MBEDTLS_SSL_MINOR_VERSION_3 ||
         ssl->conf->min_minor_ver > MBEDTLS_SSL_MINOR_VERSION_3 ||
@@ -6598,6 +6600,14 @@ static int ssl_context_load( mbedtls_ssl_context *ssl,
     /*
      * Saved fields from top-level ssl_context structure
      */
+#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1) || defined(MBEDTLS_SSL_PROTO_TLS1_2)
+    if( (size_t)( end - p ) < 8 )
+        return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
+
+    memcpy( ssl->in_ctr, p, 8 );
+    p += 8;
+#endif
+
 #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
     if( (size_t)( end - p ) < 4 )
         return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
