bl4ck5un / mbedtls-SGX

mbedtls-SGX: a SGX-friendly TLS stack (ported from mbedtls)
Apache License 2.0
91 stars 32 forks source link

SSL - Hardware acceleration function returned with error : UNKNOWN ERROR CODE (0015) #23

Open XNinety9 opened 2 years ago

XNinety9 commented 2 years ago

Hi.

I'm using mbedtls-SGX for a project and this piece of code keeps failing with various errors:

[&](uint64_t index) {
        client_opt_t opt;
        unsigned char buf[512];
        char port[10];
        client_opt_init(&opt);
        opt.debug_level = 1;
        opt.server_name = thread_info->platform_address;
        opt.request_page = "/incoming_trigger";
        opt.server_port = "8000";
        // disable certificate verification
        opt.auth_mode = MBEDTLS_SSL_VERIFY_NONE;
        // post request
        opt.request_type = DFL_POST;
        std::string payload = std::to_string(index);

        return ssl_client(
            opt,                    // Client options structure
            nullptr,                // Headers
            0,                      // Number of headers
            buf,                    // Output buffer
            sizeof buf,             // Output buffer size
            payload.c_str()         // Payload
        );
}

As I said the errors I get vary, here is the last I got were:

[ LOG] ssl_client:488: Seeding the random number generator...
[ LOG] ssl_client:503: Loading the CA root certificate
[ LOG] ssl_client:540: connecting to TCP:XX.XX.XX.XX:8000...
[CRIT] ssl_client:548:  mbedtls_net_connect returned -0xffff80d2
[CRIT] ssl_client:1162: Last error was: -0xFFFF80D2 - SSL - Memory allocation failed : OID - OID is not found
[ LOG] ssl_client:488: Seeding the random number generator...
[ LOG] ssl_client:503: Loading the CA root certificate
[ LOG] ssl_client:540: connecting to TCP:XX.XX.XX.XX:8000...
[CRIT] ssl_client:548:  mbedtls_net_connect returned -0xffff806b
[CRIT] ssl_client:1162: Last error was: -0xFFFF806B - SSL - Hardware acceleration function returned with error : UNKNOWN ERROR CODE (0015)
[ LOG] ssl_client:488: Seeding the random number generator...
[ LOG] ssl_client:503: Loading the CA root certificate
[ LOG] ssl_client:540: connecting to TCP:147.210.128.152:8000...
[CRIT] ssl_client:548:  mbedtls_net_connect returned -0xffff805b
[CRIT] ssl_client:1162: Last error was: -0xFFFF805B - SSL - Hardware acceleration function returned with error : UNKNOWN ERROR CODE (0025)

Can someone help?