tsNetGetFileSync stopped working - tsNetCABundle problem
Posted: Fri Jan 01, 2021 2:56 pm
Happy New Year everyone, let's hope it's good for everybody and we will be able to leave the mess of 2020 behind.
I'm not off to the greatest start though, with an issue on a server using tsNet.
I have been using tsNetGetFileSync on a site for some time to download product data image files from a head office source hosted on Amazon AWS.
This has stopped working in the last few days, with the the message "tsneterr: (60) SSL certificate problem: unable to get local issuer certificate"
I don't think anything changed on the server, but I am prepared to believe anything, I just don't know how to troubleshoot this.
I have uploaded the ca-bundle.crt from the tsNet library to the server, and wondered if there was something that expired, so I have uploaded the latest ca-bundle.crt from LiveCode 9.6.2-rc1 but the same problem occurs. The file is located in <document root>/tsNetssl/ca-bundle.crt"
Code (having set up some path and filename vars)Any ideas how to resolve this? I am thinking there must be something I need to do on the server that explicitly tells the tsNetBundle what to do with the CA lookups but I don't know what can have changed. It is a shared server and the other sites on it use exactly the same tsNetGetFileSync without having this issue, so I am not sure what hosting chsnges can have been made that wouldn't affect all of them.
I'm not off to the greatest start though, with an issue on a server using tsNet.
I have been using tsNetGetFileSync on a site for some time to download product data image files from a head office source hosted on Amazon AWS.
This has stopped working in the last few days, with the the message "tsneterr: (60) SSL certificate problem: unable to get local issuer certificate"
I don't think anything changed on the server, but I am prepared to believe anything, I just don't know how to troubleshoot this.
I have uploaded the ca-bundle.crt from the tsNet library to the server, and wondered if there was something that expired, so I have uploaded the latest ca-bundle.crt from LiveCode 9.6.2-rc1 but the same problem occurs. The file is located in <document root>/tsNetssl/ca-bundle.crt"
Code (having set up some path and filename vars)
Code: Select all
tsNetInit
wait 100 milliseconds with messages
put sDocRoot & "/tsNetssl/ca-bundle.crt" into tCAbndl
tsNetCABundle (tCAbndl)
wait 100 milliseconds with messages
--Download the required image files from AWS server
put fetchImgFile(sDataFile,tAWSsource,tDestinationPath) into gStatus
doErrorCheck gStatus
tsNetClose
function fetchImgFile pDataFile,pAWSsource,pDestinationPath
put pDestinationPath & pDataFile into tDestination
put pAWSsource & pDataFile into tFileSource
put empty into tHeaders
put empty into tRecvHeaders
put empty into tBytes
put empty into tSettings
--put true into tSettings["use_ssl"] --forcing ssl doesn't cange the error messsage
put tsNetGetFileSync(tDestination,tFileSource,tHeaders,tRecvHeaders,tBytes,tSettings) into tResult
if tResult contains "error" or tResult contains "tsNeterr" then
return "error :" && tResult && tBytes && tRecvHeaders
else
return "Downloaded" && pDataFile && "to" && tDestination && "<br /><br />" && tBytes && tRecvHeaders
end if
end fetchImgFile