BaH.libcurl with https fails, "BADCERT_NOT_TRUSTED"

Started by nokkusuu, June 02, 2018, 18:48:05

Previous topic - Next topic

nokkusuu

When using libcurl (newest version, should support TLS) I get an error saying BADCERT_NOT_TRUSTED.

Executing:test.debug.exe
* Rebuilt URL to: https://www.google.com/
*   Trying 172.217.4.196...
* TCP_NODELAY set
* Connected to www.google.com (172.217.4.196) port 443 (#0)
* mbedTLS: Connecting to www.google.com:443
* mbedTLS: Set min SSL version to TLS 1.0
* mbedTLS: Handshake complete, cipher is TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
* Cert verify failed: BADCERT_NOT_TRUSTED
* Closing connection 0

Process complete


I'm no expert with this stuff, so I'm very confused. Any help is appreciated.

Brucey

Hi,

You need to provide libcurl with certificates it can validate against. Have a look at ex_08.bmx in the examples folder, which shows how to connect to google.com over https.

The other option is not to validate, but you'd typically not want to do that.

nokkusuu

#2
I don't see an ex_08.bmx. I'm using the latest version from GitHub; is there a newer version elsewhere?

EDIT: Nevermind, I found an example in an older version of libcurlssl, with the name ex_08.bmx. I assume that's the file you were referring to. Works well now, thanks!

Derron

nokkusuu is right, ex_08.bmx is no longer in the repository.


bye
Ron

Brucey

Apologies, the example was missing from the current module.