0
will

位於standard sdk的\component\common\example\ssl_server.c的範例

if((ret = mbedtls_x509_crt_parse(&server_x509, (const unsigned char *) mbedtls_test_srv_crt, mbedtls_test_srv_crt_len)) != 0) {
printf(" failed\n ! mbedtls_x509_crt_parse returned %d\n\n", ret);
goto exit;
}

if((ret = mbedtls_x509_crt_parse(&server_x509, (const unsigned char *) mbedtls_test_cas_pem, mbedtls_test_cas_pem_len)) != 0) {
printf(" failed\n ! mbedtls_x509_crt_parse returned %d\n\n", ret);
goto exit;
}

if((ret = mbedtls_pk_parse_key(&server_pk, (const unsigned char *) mbedtls_test_srv_key, mbedtls_test_srv_key_len, NULL, 0)) != 0) {
printf(" failed\n ! mbedtls_pk_parse_key returned %d\n\n", ret);
goto exit;
}

範例中有使用到

1.mbedtls_test_srv_crt,

2.mbedtls_test_cas_pem,

3.mbedtls_test_srv_key

=====================================

1. 請問每個ameba device每次運作ssl server時,都需要配置不同的,crt/pem/key嗎?

2. ameba裡有funcion可以產生這些crt/pem/key嗎?

sean 回答了