Skip to content

Commit

Permalink
polarssl: support CURLOPT_CAPATH / --capath
Browse files Browse the repository at this point in the history
Signed-off-by: Catalin Patulea <cat@vv.carleton.ca>
  • Loading branch information
cpatulea authored and bagder committed Sep 8, 2014
1 parent 55f8b03 commit af45542
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/vtls/polarssl.c
Expand Up @@ -201,6 +201,22 @@ polarssl_connect_step1(struct connectdata *conn,
}
}

if(data->set.str[STRING_SSL_CAPATH]) {
ret = x509_crt_parse_path(&connssl->cacert,
data->set.str[STRING_SSL_CAPATH]);

if(ret<0) {
#ifdef POLARSSL_ERROR_C
error_strerror(ret, errorbuf, sizeof(errorbuf));
#endif /* POLARSSL_ERROR_C */
failf(data, "Error reading ca cert path %s - PolarSSL: (-0x%04X) %s",
data->set.str[STRING_SSL_CAPATH], -ret, errorbuf);

if(data->set.ssl.verifypeer)
return CURLE_SSL_CACERT_BADFILE;
}
}

/* Load the client certificate */
memset(&connssl->clicert, 0, sizeof(x509_crt));

Expand Down

0 comments on commit af45542

Please sign in to comment.