You can use the IfSSL property.
The following JavaScript Sample shows how to use IfSSL property.
<script language="javascript">
function btnUpload_onclick()
{
if (window.location.protocol != "https:"){
frmScan.DynamicWebTwain1.HTTPPort = 80;
frmScan.DynamicWebTwain1.IfSSL = false; // if 80 is the port number of non-secure port
}
else{
frmScan.DynamicWebTwain1.HTTPPort = 443;
frmScan.DynamicWebTwain1.IfSSL = true; // if 443 is the port number of secure port
}
frmScan.DynamicWebTwain1.HTTPUploadThroughPost("127.0.0.1", 0, "/SaveToFile.php", "imageData.jpg");
if (frmScan.DynamicWebTwain1.ErrorCode != 0)
alert(frmScan.DynamicWebTwain1.ErrorString);
else //succeded
alert("Successful");
}
</script>
Note:
Dynamic Web TWAIN Plug-in 5.1 or earlier versions didn't have full support for SSL. In Dynamic Web TWAIN Plug-in 5.2, we improved SSL support. In Dynamic Web TWAIN Plug-in 6.0, we added two methods BindSSLCert and BindSSLCertEx to relieve the users from having to select the Certificate when uploading.
References:
IfSSL HTTPUploadThroughPost
