SyntaxBomb - Indie Coders

Languages & Coding => BlitzMax / BlitzMax NG => Brucey's Modules => Topic started by: nokkusuu on June 02, 2018, 06:48:05 PM

Title: BaH.libcurl with https fails, "BADCERT_NOT_TRUSTED"
Post by: nokkusuu on June 02, 2018, 06:48:05 PM
When using libcurl (newest version, should support TLS) I get an error saying BADCERT_NOT_TRUSTED.

Code: [Select]
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.
Title: Re: BaH.libcurl with https fails, "BADCERT_NOT_TRUSTED"
Post by: Brucey on June 02, 2018, 09:20:23 PM
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.
Title: Re: BaH.libcurl with https fails, "BADCERT_NOT_TRUSTED"
Post by: nokkusuu on June 03, 2018, 01:53:24 AM
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!
Title: Re: BaH.libcurl with https fails, "BADCERT_NOT_TRUSTED"
Post by: Derron on June 03, 2018, 06:40:17 AM
nokkusuu is right, ex_08.bmx is no longer in the repository.


bye
Ron
Title: Re: BaH.libcurl with https fails, "BADCERT_NOT_TRUSTED"
Post by: Brucey on June 03, 2018, 02:16:23 PM
Apologies, the example was missing from the current module.
SimplePortal 2.3.6 © 2008-2014, SimplePortal