Use MBEDTLS_SSL_CONTEXT_SERIALIZATION flag
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index 79900be..2026f83 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -280,6 +280,13 @@
 #define USAGE_ECRESTART ""
 #endif
 
+#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
+#define USAGE_SERIALIZATION \
+    "    serialize=%%d        default: 0 (do not serialize/deserialize)\n"
+#else
+#define USAGE_SERIALIZATION ""
+#endif
+
 #define USAGE \
     "\n usage: ssl_client2 param=<>...\n"                   \
     "\n acceptable parameters:\n"                           \
@@ -344,7 +351,7 @@
     "                                configuration macro is defined and 1\n"  \
     "                                otherwise. The expansion of the macro\n" \
     "                                is printed if it is defined\n"     \
-    "    serialize=%%d        default: 0 (do not serialize/deserialize)\n" \
+    USAGE_SERIALIZATION                                     \
     " acceptable ciphersuite names:\n"
 
 #define ALPN_LIST_SIZE  10
@@ -2355,6 +2362,7 @@
     /*
      * 7c. Simulate serialize/deserialize and go back to data exchange
      */
+#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
     if( opt.serialize != 0)
     {
         size_t len;
@@ -2397,7 +2405,7 @@
             goto exit;
         }
     }
-
+#endif
 
     /*
      * 7d. Continue doing data exchanges?
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index 7af5c68..5c640ab 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -385,6 +385,13 @@
 #define USAGE_CURVES ""
 #endif
 
+#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
+#define USAGE_SERIALIZATION \
+    "    serialize=%%d        default: 0 (do not serialize/deserialize)\n"
+#else
+#define USAGE_SERIALIZATION ""
+#endif
+
 #define USAGE \
     "\n usage: ssl_server2 param=<>...\n"                   \
     "\n acceptable parameters:\n"                           \
@@ -446,7 +453,7 @@
     "                                configuration macro is defined and 1\n"  \
     "                                otherwise. The expansion of the macro\n" \
     "                                is printed if it is defined\n"     \
-    "    serialize=%%d        default: 0 (do not serialize/deserialize)\n" \
+    USAGE_SERIALIZATION                                     \
     " acceptable ciphersuite names:\n"
 
 
@@ -3340,6 +3347,7 @@
     /*
      * 7b. Simulate serialize/deserialize and go back to data exchange
      */
+#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
     if( opt.serialize != 0)
     {
         size_t len;
@@ -3382,6 +3390,7 @@
             goto exit;
         }
     }
+#endif
 
     /*
      * 7c. Continue doing data exchanges?