Index: /pjproject/trunk/pjlib/include/pj/ssl_sock.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/ssl_sock.h	(revision 5820)
+++ /pjproject/trunk/pjlib/include/pj/ssl_sock.h	(revision 5821)
@@ -192,4 +192,8 @@
 } pj_ssl_cert_info;
 
+/**
+ * The SSL certificate buffer.
+ */
+typedef pj_str_t pj_ssl_cert_buffer;
 
 /**
@@ -242,4 +246,23 @@
 						pj_ssl_cert_t **p_cert);
 
+
+/**
+ * Create credential from data buffer. The certificate expected is in 
+ * PEM format.
+ *
+ * @param CA_file	The buffer of trusted CA list.
+ * @param cert_file	The buffer of certificate.
+ * @param privkey_file	The buffer of private key.
+ * @param privkey_pass	The password of private key, if any.
+ * @param p_cert	Pointer to credential instance to be created.
+ *
+ * @return		PJ_SUCCESS when successful.
+ */
+PJ_DECL(pj_status_t) pj_ssl_cert_load_from_buffer(pj_pool_t *pool,
+					const pj_ssl_cert_buffer *CA_buf,
+					const pj_ssl_cert_buffer *cert_buf,
+					const pj_ssl_cert_buffer *privkey_buf,
+					const pj_str_t *privkey_pass,
+					pj_ssl_cert_t **p_cert);
 
 /**
Index: /pjproject/trunk/pjlib/src/pj/ssl_sock_gtls.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ssl_sock_gtls.c	(revision 5820)
+++ /pjproject/trunk/pjlib/src/pj/ssl_sock_gtls.c	(revision 5821)
@@ -190,7 +190,9 @@
 };
 
-
-/* Certificate/credential structure definition. */
-struct pj_ssl_cert_t {
+/*
+ * Certificate/credential structure definition.
+ */
+struct pj_ssl_cert_t
+{
     pj_str_t CA_file;
     pj_str_t CA_path;
@@ -198,5 +200,11 @@
     pj_str_t privkey_file;
     pj_str_t privkey_pass;
+
+    /* Certificate buffer. */
+    pj_ssl_cert_buffer CA_buf;
+    pj_ssl_cert_buffer cert_buf;
+    pj_ssl_cert_buffer privkey_buf;
 };
+
 
 /* GnuTLS available ciphers */
@@ -982,4 +990,50 @@
                 goto out;
         }
+
+        if (cert->CA_buf.slen) {
+            gnutls_datum_t ca;
+            ca.data = (unsigned char*)cert->CA_buf.ptr;
+            ca.size = cert->CA_buf.slen;
+            ret = gnutls_certificate_set_x509_trust_mem(ssock->xcred,
+                                                        &ca,
+                                                        GNUTLS_X509_FMT_PEM);
+            if (ret < 0)
+                ret = gnutls_certificate_set_x509_trust_mem(
+                		ssock->xcred, &ca, GNUTLS_X509_FMT_DER);
+            if (ret < 0)
+                goto out;
+        }
+
+        if (cert->cert_buf.slen && cert->privkey_buf.slen) {
+            gnutls_datum_t cert_buf;
+            gnutls_datum_t privkey_buf;
+
+            cert_buf.data = (unsigned char*)cert->CA_buf.ptr;
+            cert_buf.size = cert->CA_buf.slen;
+            privkey_buf.data = (unsigned char*)cert->privkey_buf.ptr;
+            privkey_buf.size = cert->privkey_buf.slen;
+
+            const char *prikey_pass = cert->privkey_pass.slen
+                                    ? cert->privkey_pass.ptr
+                                    : NULL;
+            ret = gnutls_certificate_set_x509_key_mem2(ssock->xcred,
+                                                       &cert_buf,
+                                                       &privkey_buf,
+                                                       GNUTLS_X509_FMT_PEM,
+                                                       prikey_pass,
+                                                       0);
+            /* Load DER format */
+            /*
+            if (ret != GNUTLS_E_SUCCESS)
+                ret = gnutls_certificate_set_x509_key_mem2(ssock->xcred,
+                                                           &cert_buf,
+                                                           &privkey_buf,
+                                                           GNUTLS_X509_FMT_DER,
+                                                           prikey_pass,
+                                                           0);
+            */                                                           
+            if (ret < 0)
+                goto out;
+        }
     }
 
@@ -2090,4 +2144,26 @@
 }
 
+PJ_DEF(pj_status_t) pj_ssl_cert_load_from_buffer(pj_pool_t *pool,
+					const pj_ssl_cert_buffer *CA_buf,
+					const pj_ssl_cert_buffer *cert_buf,
+					const pj_ssl_cert_buffer *privkey_buf,
+					const pj_str_t *privkey_pass,
+					pj_ssl_cert_t **p_cert)
+{
+    pj_ssl_cert_t *cert;
+
+    PJ_ASSERT_RETURN(pool && CA_buf && cert_buf && privkey_buf, PJ_EINVAL);
+
+    cert = PJ_POOL_ZALLOC_T(pool, pj_ssl_cert_t);
+    pj_strdup(pool, &cert->CA_buf, CA_buf);
+    pj_strdup(pool, &cert->cert_buf, cert_buf);
+    pj_strdup(pool, &cert->privkey_buf, privkey_buf);
+    pj_strdup_with_null(pool, &cert->privkey_pass, privkey_pass);
+
+    *p_cert = cert;
+
+    return PJ_SUCCESS;
+}
+
 /* Store credentials. */
 PJ_DEF(pj_status_t) pj_ssl_sock_set_certificate( pj_ssl_sock_t *ssock,
@@ -2106,4 +2182,8 @@
     pj_strdup_with_null(pool, &cert_->privkey_file, &cert->privkey_file);
     pj_strdup_with_null(pool, &cert_->privkey_pass, &cert->privkey_pass);
+
+    pj_strdup(pool, &cert_->CA_buf, &cert->CA_buf);
+    pj_strdup(pool, &cert_->cert_buf, &cert->cert_buf);
+    pj_strdup(pool, &cert_->privkey_buf, &cert->privkey_buf);
 
     ssock->cert = cert_;
Index: /pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c	(revision 5820)
+++ /pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c	(revision 5821)
@@ -294,4 +294,9 @@
     pj_str_t privkey_file;
     pj_str_t privkey_pass;
+
+    /* Certificate buffer. */
+    pj_ssl_cert_buffer CA_buf;
+    pj_ssl_cert_buffer cert_buf;
+    pj_ssl_cert_buffer privkey_buf;
 };
 
@@ -964,4 +969,94 @@
 #endif
 	}
+
+	/* Load from buffer. */
+	if (cert->cert_buf.slen) {
+	    BIO *cbio;
+	    X509 *xcert = NULL;
+	    
+	    cbio = BIO_new_mem_buf((void*)cert->cert_buf.ptr,
+				   cert->cert_buf.slen);
+	    if (cbio != NULL) {
+		xcert = PEM_read_bio_X509(cbio, NULL, 0, NULL);
+		if (xcert != NULL) {
+		    rc = SSL_CTX_use_certificate(ctx, xcert);
+		    if (rc != 1) {
+			status = GET_SSL_STATUS(ssock);
+			PJ_LOG(1, (ssock->pool->obj_name, "Error loading "
+				   "chain certificate from buffer"));
+			X509_free(xcert);
+			BIO_free(cbio);
+			SSL_CTX_free(ctx);
+			return status;
+		    }
+		    X509_free(xcert);
+		}
+		BIO_free(cbio);
+	    }	    
+	}
+
+	if (cert->CA_buf.slen) {
+	    BIO *cbio = BIO_new_mem_buf((void*)cert->CA_buf.ptr,
+					cert->CA_buf.slen);
+	    X509_STORE *cts = SSL_CTX_get_cert_store(ctx);
+
+	    if (cbio && cts) {
+		STACK_OF(X509_INFO) *inf = PEM_X509_INFO_read_bio(cbio, NULL, 
+								  NULL, NULL);
+
+		if (inf != NULL) {
+		    int i = 0;		    
+		    for (; i < sk_X509_INFO_num(inf); i++) {
+			X509_INFO *itmp = sk_X509_INFO_value(inf, i);
+			if (itmp->x509) {
+			    X509_STORE_add_cert(cts, itmp->x509);
+			}
+		    }
+		}
+		sk_X509_INFO_pop_free(inf, X509_INFO_free);
+		BIO_free(cbio);
+	    }
+	}
+
+	if (cert->privkey_buf.slen) {
+	    BIO *kbio;	    
+	    EVP_PKEY *pkey = NULL;
+
+	    kbio = BIO_new_mem_buf((void*)cert->privkey_buf.ptr,
+				   cert->privkey_buf.slen);
+	    if (kbio != NULL) {
+		pkey = PEM_read_bio_PrivateKey(kbio, NULL, 0, NULL);
+		if (pkey) {
+		    rc = SSL_CTX_use_PrivateKey(ctx, pkey);
+		    if (rc != 1) {
+			status = GET_SSL_STATUS(ssock);
+			PJ_LOG(1, (ssock->pool->obj_name, "Error adding "
+				   "private key from buffer"));
+			EVP_PKEY_free(pkey);
+			BIO_free(kbio);
+			SSL_CTX_free(ctx);
+			return status;
+		    }
+		    EVP_PKEY_free(pkey);
+		}
+		if (ssock->is_server) {
+		    dh = PEM_read_bio_DHparams(kbio, NULL, NULL, NULL);
+		    if (dh != NULL) {
+			if (SSL_CTX_set_tmp_dh(ctx, dh)) {
+			    options = SSL_OP_CIPHER_SERVER_PREFERENCE |
+    #if !defined(OPENSSL_NO_ECDH) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+				      SSL_OP_SINGLE_ECDH_USE |
+    #endif
+				      SSL_OP_SINGLE_DH_USE;
+			    options = SSL_CTX_set_options(ctx, options);
+			    PJ_LOG(4,(ssock->pool->obj_name, "SSL DH "
+				     "initialized, PFS cipher-suites enabled"));
+			}
+			DH_free(dh);
+		    }
+		}
+		BIO_free(kbio);
+	    }	    
+	}
     }
 
@@ -1233,5 +1328,5 @@
 		break;
 	    }
-	}
+	}	
     }
 
@@ -2555,4 +2650,25 @@
 }
 
+PJ_DEF(pj_status_t) pj_ssl_cert_load_from_buffer(pj_pool_t *pool,
+					const pj_ssl_cert_buffer *CA_buf,
+					const pj_ssl_cert_buffer *cert_buf,
+					const pj_ssl_cert_buffer *privkey_buf,
+					const pj_str_t *privkey_pass,
+					pj_ssl_cert_t **p_cert)
+{
+    pj_ssl_cert_t *cert;
+
+    PJ_ASSERT_RETURN(pool && CA_buf && cert_buf && privkey_buf, PJ_EINVAL);
+
+    cert = PJ_POOL_ZALLOC_T(pool, pj_ssl_cert_t);
+    pj_strdup(pool, &cert->CA_buf, CA_buf);
+    pj_strdup(pool, &cert->cert_buf, cert_buf);
+    pj_strdup(pool, &cert->privkey_buf, privkey_buf);
+    pj_strdup_with_null(pool, &cert->privkey_pass, privkey_pass);
+
+    *p_cert = cert;
+
+    return PJ_SUCCESS;
+}
 
 /* Set SSL socket credentials. */
@@ -2573,4 +2689,8 @@
     pj_strdup_with_null(pool, &cert_->privkey_file, &cert->privkey_file);
     pj_strdup_with_null(pool, &cert_->privkey_pass, &cert->privkey_pass);
+
+    pj_strdup(pool, &cert_->CA_buf, &cert->CA_buf);
+    pj_strdup(pool, &cert_->cert_buf, &cert->cert_buf);
+    pj_strdup(pool, &cert_->privkey_buf, &cert->privkey_buf);
 
     ssock->cert = cert_;
Index: /pjproject/trunk/pjlib/src/pjlib-test/ssl_sock.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/ssl_sock.c	(revision 5820)
+++ /pjproject/trunk/pjlib/src/pjlib-test/ssl_sock.c	(revision 5821)
@@ -28,4 +28,5 @@
 #define CERT_PRIVKEY_PASS	    ""
 
+#define TEST_LOAD_FROM_FILES 1
 
 #if INCLUDE_SSLSOCK_TEST
@@ -493,4 +494,25 @@
 }
 
+#if (TEST_LOAD_FROM_FILE==0)
+static pj_status_t load_cert_to_buf(pj_pool_t *pool, const pj_str_t *file_name,
+				    pj_ssl_cert_buffer *buf)
+{
+    pj_status_t status;
+    pj_oshandle_t fd = 0;
+    pj_ssize_t size = (pj_ssize_t)pj_file_size(file_name->ptr);
+
+    status = pj_file_open(pool, file_name->ptr, PJ_O_RDONLY, &fd);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    buf->ptr = (char*)pj_pool_zalloc(pool, size+1);
+    status = pj_file_read(fd, buf->ptr, &size);
+    buf->slen = size;
+
+    pj_file_close(fd);
+    fd = NULL;
+    return status;
+}
+#endif
 
 static int echo_test(pj_ssl_sock_proto srv_proto, pj_ssl_sock_proto cli_proto,
@@ -550,12 +572,35 @@
     /* Set server cert */
     {
-	pj_str_t tmp1, tmp2, tmp3, tmp4;
-
-	status = pj_ssl_cert_load_from_files(pool, 
-					     pj_strset2(&tmp1, (char*)CERT_CA_FILE), 
-					     pj_strset2(&tmp2, (char*)CERT_FILE), 
-					     pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), 
-					     pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), 
+	pj_str_t ca_file = pj_str(CERT_CA_FILE);
+	pj_str_t cert_file = pj_str(CERT_FILE);
+	pj_str_t privkey_file = pj_str(CERT_PRIVKEY_FILE);
+	pj_str_t privkey_pass = pj_str(CERT_PRIVKEY_PASS);
+
+#if (defined(TEST_LOAD_FROM_FILES) && TEST_LOAD_FROM_FILES==1)
+	status = pj_ssl_cert_load_from_files(pool, &ca_file, &cert_file, 
+					     &privkey_file, &privkey_pass,
 					     &cert);
+#else
+	pj_ssl_cert_buffer ca_buf, cert_buf, privkey_buf;
+
+	status = load_cert_to_buf(pool, &ca_file, &ca_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = load_cert_to_buf(pool, &cert_file, &cert_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = load_cert_to_buf(pool, &privkey_file, &privkey_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = pj_ssl_cert_load_from_buffer(pool, &ca_buf, &cert_buf,
+					      &privkey_buf, &privkey_pass, 
+					      &cert);
+#endif
 	if (status != PJ_SUCCESS) {
 	    goto on_return;
@@ -614,14 +659,27 @@
 
 	if (!client_provide_cert) {
-	    pj_str_t tmp1, tmp2;
-
-	    pj_strset2(&tmp1, (char*)CERT_CA_FILE);
-	    pj_strset2(&tmp2, NULL);
-	    status = pj_ssl_cert_load_from_files(pool, 
-						 &tmp1, &tmp2, &tmp2, &tmp2,
-						 &cert);
+	    pj_str_t ca_file = pj_str(CERT_CA_FILE);
+	    pj_str_t null_str = pj_str("");
+
+#if (defined(TEST_LOAD_FROM_FILES) && TEST_LOAD_FROM_FILES==1)
+	    status = pj_ssl_cert_load_from_files(pool, &ca_file, &null_str, 
+						 &null_str, &null_str, &cert);
+#else
+	    pj_ssl_cert_buffer null_buf, ca_buf;
+
+	    null_buf.slen = 0;
+
+	    status = load_cert_to_buf(pool, &ca_file, &ca_buf);
 	    if (status != PJ_SUCCESS) {
 		goto on_return;
 	    }
+
+	    status = pj_ssl_cert_load_from_buffer(pool, &ca_buf, &null_buf,
+						  &null_buf, &null_str, &cert);
+#endif
+	    if (status != PJ_SUCCESS) {
+		goto on_return;
+	    }
+
 	}
 
@@ -825,11 +883,35 @@
     /* Set cert */
     {
-	pj_str_t tmp1, tmp2, tmp3, tmp4;
-	status = pj_ssl_cert_load_from_files(pool, 
-					     pj_strset2(&tmp1, (char*)CERT_CA_FILE), 
-					     pj_strset2(&tmp2, (char*)CERT_FILE), 
-					     pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), 
-					     pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), 
+	pj_str_t ca_file = pj_str(CERT_CA_FILE);
+	pj_str_t cert_file = pj_str(CERT_FILE);
+	pj_str_t privkey_file = pj_str(CERT_PRIVKEY_FILE);
+	pj_str_t privkey_pass = pj_str(CERT_PRIVKEY_PASS);
+
+#if (defined(TEST_LOAD_FROM_FILES) && TEST_LOAD_FROM_FILES==1)
+	status = pj_ssl_cert_load_from_files(pool, &ca_file, &cert_file, 
+					     &privkey_file, &privkey_pass,
 					     &cert);
+#else
+	pj_ssl_cert_buffer ca_buf, cert_buf, privkey_buf;
+
+	status = load_cert_to_buf(pool, &ca_file, &ca_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = load_cert_to_buf(pool, &cert_file, &cert_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = load_cert_to_buf(pool, &privkey_file, &privkey_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = pj_ssl_cert_load_from_buffer(pool, &ca_buf, &cert_buf,
+					      &privkey_buf, &privkey_pass, 
+					      &cert);
+#endif
 	if (status != PJ_SUCCESS) {
 	    goto on_return;
@@ -1132,12 +1214,35 @@
     /* Set cert */
     {
-	pj_str_t tmp1, tmp2, tmp3, tmp4;
-
-	status = pj_ssl_cert_load_from_files(pool, 
-					     pj_strset2(&tmp1, (char*)CERT_CA_FILE), 
-					     pj_strset2(&tmp2, (char*)CERT_FILE), 
-					     pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), 
-					     pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), 
+	pj_str_t ca_file = pj_str(CERT_CA_FILE);
+	pj_str_t cert_file = pj_str(CERT_FILE);
+	pj_str_t privkey_file = pj_str(CERT_PRIVKEY_FILE);
+	pj_str_t privkey_pass = pj_str(CERT_PRIVKEY_PASS);
+
+#if (defined(TEST_LOAD_FROM_FILES) && TEST_LOAD_FROM_FILES==1)
+	status = pj_ssl_cert_load_from_files(pool, &ca_file, &cert_file, 
+					     &privkey_file, &privkey_pass,
 					     &cert);
+#else
+	pj_ssl_cert_buffer ca_buf, cert_buf, privkey_buf;
+
+	status = load_cert_to_buf(pool, &ca_file, &ca_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = load_cert_to_buf(pool, &cert_file, &cert_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = load_cert_to_buf(pool, &privkey_file, &privkey_buf);
+	if (status != PJ_SUCCESS) {
+	    goto on_return;
+	}
+
+	status = pj_ssl_cert_load_from_buffer(pool, &ca_buf, &cert_buf,
+					      &privkey_buf, &privkey_pass, 
+					      &cert);
+#endif
 	if (status != PJ_SUCCESS) {
 	    goto on_return;
Index: /pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h	(revision 5820)
+++ /pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h	(revision 5821)
@@ -101,4 +101,25 @@
      */
     pj_str_t	privkey_file;
+
+    /**
+     * Certificate of Authority (CA) buffer. If ca_list_file, ca_list_path,
+     * cert_file or privkey_file are set, this setting will be ignored.
+     */
+    pj_ssl_cert_buffer ca_buf;
+
+    /**
+     * Public endpoint certificate buffer, which will be used as client-
+     * side  certificate for outgoing TLS connection, and server-side
+     * certificate for incoming TLS connection. If ca_list_file, ca_list_path,
+     * cert_file or privkey_file are set, this setting will be ignored.
+     */
+    pj_ssl_cert_buffer cert_buf;
+
+    /**
+     * Optional private key buffer of the endpoint certificate to be used. 
+     * If ca_list_file, ca_list_path, cert_file or privkey_file are set, 
+     * this setting will be ignored.
+     */
+    pj_ssl_cert_buffer privkey_buf;
 
     /**
@@ -340,4 +361,9 @@
     pj_strdup_with_null(pool, &dst->sigalgs, &src->sigalgs);
     pj_strdup_with_null(pool, &dst->entropy_path, &src->entropy_path);
+
+    pj_strdup(pool, &dst->ca_buf, &src->ca_buf);
+    pj_strdup(pool, &dst->cert_buf, &src->cert_buf);
+    pj_strdup(pool, &dst->privkey_buf, &src->privkey_buf);
+
     if (src->ciphers_num) {
 	unsigned i;
Index: /pjproject/trunk/pjsip/include/pjsua2/siptypes.hpp
===================================================================
--- /pjproject/trunk/pjsip/include/pjsua2/siptypes.hpp	(revision 5820)
+++ /pjproject/trunk/pjsip/include/pjsua2/siptypes.hpp	(revision 5821)
@@ -144,4 +144,25 @@
      */
     string		password;
+
+    /**
+     * Certificate of Authority (CA) buffer. If CaListFile, certFile or
+     * privKeyFile are set, this setting will be ignored.
+     */
+    string		CaBuf;
+
+    /**
+     * Public endpoint certificate buffer, which will be used as client-
+     * side  certificate for outgoing TLS connection, and server-side
+     * certificate for incoming TLS connection. If CaListFile, certFile or
+     * privKeyFile are set, this setting will be ignored.
+     */
+    string		certBuf;
+
+    /**
+     * Optional private key buffer of the endpoint certificate to be used. 
+     * If CaListFile, certFile or privKeyFile are set, this setting will 
+     * be ignored.
+     */
+    string		privKeyBuf;
 
     /**
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5820)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5821)
@@ -587,5 +587,6 @@
     if (listener->tls_setting.cert_file.slen ||
 	listener->tls_setting.ca_list_file.slen ||
-	listener->tls_setting.ca_list_path.slen) 
+	listener->tls_setting.ca_list_path.slen || 
+	listener->tls_setting.privkey_file.slen) 
     {
 	status = pj_ssl_cert_load_from_files2(pool,
@@ -598,4 +599,16 @@
 	if (status != PJ_SUCCESS)
 	    goto on_error;
+    } else if (listener->tls_setting.ca_buf.slen ||
+	       listener->tls_setting.cert_buf.slen||
+	       listener->tls_setting.privkey_buf.slen)
+    {
+	status = pj_ssl_cert_load_from_buffer(pool,
+			&listener->tls_setting.ca_buf,
+			&listener->tls_setting.cert_buf,
+			&listener->tls_setting.privkey_buf,
+			&listener->tls_setting.password,
+			&listener->cert);
+	if (status != PJ_SUCCESS)
+	    goto on_error;    
     }
 
Index: /pjproject/trunk/pjsip/src/pjsua2/siptypes.cpp
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua2/siptypes.cpp	(revision 5820)
+++ /pjproject/trunk/pjsip/src/pjsua2/siptypes.cpp	(revision 5821)
@@ -164,4 +164,7 @@
     ts.privkey_file	= str2Pj(this->privKeyFile);
     ts.password		= str2Pj(this->password);
+    ts.ca_buf		= str2Pj(this->CaBuf);
+    ts.cert_buf		= str2Pj(this->certBuf);
+    ts.privkey_buf	= str2Pj(this->privKeyBuf);
     ts.method		= this->method;
     ts.ciphers_num	= (unsigned)this->ciphers.size();
@@ -189,4 +192,7 @@
     this->privKeyFile 	= pj2Str(prm.privkey_file);
     this->password 	= pj2Str(prm.password);
+    this->CaBuf		= pj2Str(prm.ca_buf);
+    this->certBuf	= pj2Str(prm.cert_buf);
+    this->privKeyBuf	= pj2Str(prm.privkey_buf);
     this->method 	= (pjsip_ssl_method)prm.method;
     this->proto 	= prm.proto;
@@ -211,4 +217,7 @@
     NODE_READ_STRING  ( this_node, privKeyFile);
     NODE_READ_STRING  ( this_node, password);
+    NODE_READ_STRING  ( this_node, CaBuf);
+    NODE_READ_STRING  ( this_node, certBuf);
+    NODE_READ_STRING  ( this_node, privKeyBuf);
     NODE_READ_NUM_T   ( this_node, pjsip_ssl_method, method);
     readIntVector     ( this_node, "ciphers", ciphers);
@@ -230,4 +239,7 @@
     NODE_WRITE_STRING  ( this_node, privKeyFile);
     NODE_WRITE_STRING  ( this_node, password);
+    NODE_WRITE_STRING  ( this_node, CaBuf);
+    NODE_WRITE_STRING  ( this_node, certBuf);
+    NODE_WRITE_STRING  ( this_node, privKeyBuf);
     NODE_WRITE_NUM_T   ( this_node, pjsip_ssl_method, method);
     writeIntVector     ( this_node, "ciphers", ciphers);
