ssl_key_cert not available in all configurations
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 6d7b0c8..8613b8d 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -3270,8 +3270,7 @@
     return( 0 );
 }
 
-static void ssl_handshake_params_init( ssl_handshake_params *handshake,
-                                       ssl_key_cert *key_cert )
+static void ssl_handshake_params_init( ssl_handshake_params *handshake )
 {
     memset( handshake, 0, sizeof( ssl_handshake_params ) );
 
@@ -3302,10 +3301,6 @@
 #if defined(POLARSSL_ECDH_C)
     ecdh_init( &handshake->ecdh_ctx );
 #endif
-
-#if defined(POLARSSL_X509_CRT_PARSE_C)
-    handshake->key_cert = key_cert;
-#endif
 }
 
 static void ssl_transform_init( ssl_transform *transform )
@@ -3377,7 +3372,11 @@
     /* Initialize structures */
     ssl_session_init( ssl->session_negotiate );
     ssl_transform_init( ssl->transform_negotiate );
-    ssl_handshake_params_init( ssl->handshake, ssl->key_cert );
+    ssl_handshake_params_init( ssl->handshake );
+
+#if defined(POLARSSL_X509_CRT_PARSE_C)
+    ssl->handshake->key_cert = ssl->key_cert;
+#endif
 
     return( 0 );
 }