Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Getting ERROR on iHttpOpen using HTTPS

Keywords: 	 HTTPS

Question:

I'm doing an iHttpConnect, specifying @HTTPS. Then I'm doing an iHttpInit, and doing a GET. Next, when I try to do a iHttpOpen, I get an ERROR. The same thing worked fine with @HTTP.

Answer:

Here is a sample script that works for us... See if you can run the below script, then substitute your servers and try again.
        AddExtender("wwint34I.dll")
        tophandle=iBegin(0,"","")
        connecthandle=iHostConnect(tophandle, "commerce.windowware.com",@HTTPS,"", "")
        datahandle=iHttpInit(connecthandle, "GET", "/", "",0)
        rslt=iHttpOpen(datahandle, "" , 0, 0)
        xx=iReadData(datahandle, "C:\temp\abc.txt")
        iClose(datahandle)
        iClose(connecthandle)
        iClose(tophandle)
        Message("All","Done")
        exit

Resolution:

I tried the supplied code but I am still getting the value of "ERROR" in rslt after iHttpOpen. So I added the code of "err=iGetLastError()" to get some additional details. The error number I received is 12045. I tried various values for the flags field in iHttpInit to see if I could bypass the problem but same error.

I found out in Microsoft Article ID: Q182888

http://support.microsoft.com/support/kb/articles/Q182/8/88.asp

that this error occurs when the client does not know about the certificate authority that issued the server certificate. I then looked at Certificate Authorities that we were installed in IE4 and it was empty. (FYI: There is a way to programmatically bypass that error using C code.)

My guess is the internal corporate IE install team possibly missed a step. See Article ID: Q196316

http://support.microsoft.com/support/kb/articles/Q196/3/16.asp

So it looks like a reinstall of Internet Explorer.

Additional Suggestion:

If you don't have a default Certificate Authority set in the IE, then when iHttpOpen tries to initiate its conversation, it sees that it isn't going to work. However, setting one of the following two flags in the iHttpInit function might help:

1 ignore invalid date on Https Security Certificate
2 ignore bad common name (CN) on Https Security Certificate


Article ID:   W12595
Filename:   Getting ERROR on iHttpOpen with HTTPS.txt