 @@ -36,8 +36,8 @@ VALUE cSSLSocket;
  static VALUE eSSLErrorWaitReadable;
  static VALUE eSSLErrorWaitWritable;
- 
+
 -#define ossl_sslctx_set_cert(o,v)        	rb_iv_set((o),"@cert",(v))
 -#define ossl_sslctx_set_key(o,v)         	rb_iv_set((o),"@key",(v))
 +#define ossl_sslctx_set_certs(o,v)        	rb_iv_set((o),"@certs",(v))

+        self.keys.first
+      end
     end
 
     module SocketForwarder
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 9f7ee0b..9437793 100644

-    VALUE val;
+    VALUE val, val2;
+    int cert_defined = 0, key_defined = 0;

     if(OBJ_FROZEN(self)) return Qnil;
     GetSSLCTX(self, ctx);
@@ -761,19 +762,39 @@ ossl_sslctx_setup(VALUE self)
     }

     /* private key may be bundled in certificate file. */
-    val = ossl_sslctx_get_cert(self);
-    cert = NIL_P(val) ? NULL : GetX509CertPtr(val); /* NO DUP NEEDED */
