CURLSMBS oddity

I’m using CURLSMBS to download external data from emails. For testing I grabbed an email from the Valentina folks. The url is https://valentina-db.com/components/com_easydiscuss/themes/wireframe/images/emails/logo.png .

This gives an error:

[quote] Trying 80.86.91.211…
TCP_NODELAY set
Connected to valentina-db.com (80.86.91.211) port 443 (#0)
ALPN, offering http/1.1
TLSv1.3 (OUT), TLS handshake, Client hello (1):
TLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.2 (IN), TLS handshake, Certificate (11):
TLSv1.2 (OUT), TLS alert, unknown CA (560):
SSL certificate problem: unable to get local issuer certificate
Closing connection 0[/quote]

I did a bit of goggling. The error suggests that something is wrong with the certificate on the Valentina site. Why do my browser and my email client (AppleMail) download the file?

I added the non-recommended

c.OptionProxySSLVerifyPeer = 0

and I still get the error. The code is pretty much unchanged from the example:

[code]dim c as new CURLSMBS

c.CollectHeaderData = true
c.CollectOutputData = true
c.OptionTimeOut = 5
#if DebugBuild then
c.OptionVerbose = true
c.CollectDebugData = true
#Endif
c.OptionURL = URL
c.OptionProxySSLVerifyPeer = 0
c.OptionFollowLocation = true
c.OptionMaxRedirs = 3

if not Multi.AddCURL© then Break[/code]

c.OptionProxySSLVerifyHost = 0

maybe?

Or download cacert.pem here and use it.

e.g. with this code:

dim cacert as FolderItem // your cacert.pem file dim CURL as new CURLMBS CURL.OptionSSLVerifyHost = 2 // verify server CURL.OptionSSLVerifyPeer = 1 // proofs certificate is authentic CURL.SetPathCAInfo cacert

Thanks, that works fine.