Mike Downey
2004-06-18 19:28:22 UTC
I can't get any certficate information to come in. I am trying two
different SSL connection sites.
Has anyone else ever got this to work? If so what am I doing wrong?
Thanks for the help.
the site I am trying to connect to is https://secure.carbiz.com There is a
valid certificate on that site and i want to read the items of that
certificate.
I have also tried another site but cannot get it to work. Anyone have any
suggestions?
here is my code :
Private Sub Command1_Click()
Dim hInternet As Long
Dim hInstance As Long
Dim hSession As Long
Dim hRequest As Long
Dim lngRet As Long
Dim HtmlVersion As INTERNET_VERSION_INFO
Dim sBuffer As String
Dim sBufferSize As Long
Dim Cert As INTERNET_CERTIFICATE_INFO
Dim CertSize As Long
Dim bres As Long
Dim VersionInfo As INTERNET_VERSION_INFO
Dim VerInfoSize As Long
hInstance = InternetOpen(App.EXEName, INTERNET_OPEN_TYPE_PRECONFIG, _
"", "", 0)
'INTERNET_DEFAULT_HTTPS_PORT = 443
hSession = InternetConnect(hInstance, cboURL.Text, 443, _
"", "", INTERNET_SERVICE_HTTP, 0, 0)
hRequest = HttpOpenRequest(hSession, _
"GET", _
cboURL.Text, _
vbNullString, _
vbNullString, _
0, _
INTERNET_FLAG_SECURE, _
0)
lngRet = InternetQueryOptionA(hRequest, _
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT, _
Cert, _
0)
CertSize = Len(Cert)
lngRet = InternetQueryOptionA(hRequest, _
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT, _
Cert, _
CertSize)
MsgBox (Cert.lpszIssuerInfo)
MsgBox (Cert.ftStart)
End Sub
different SSL connection sites.
Has anyone else ever got this to work? If so what am I doing wrong?
Thanks for the help.
the site I am trying to connect to is https://secure.carbiz.com There is a
valid certificate on that site and i want to read the items of that
certificate.
I have also tried another site but cannot get it to work. Anyone have any
suggestions?
here is my code :
Private Sub Command1_Click()
Dim hInternet As Long
Dim hInstance As Long
Dim hSession As Long
Dim hRequest As Long
Dim lngRet As Long
Dim HtmlVersion As INTERNET_VERSION_INFO
Dim sBuffer As String
Dim sBufferSize As Long
Dim Cert As INTERNET_CERTIFICATE_INFO
Dim CertSize As Long
Dim bres As Long
Dim VersionInfo As INTERNET_VERSION_INFO
Dim VerInfoSize As Long
hInstance = InternetOpen(App.EXEName, INTERNET_OPEN_TYPE_PRECONFIG, _
"", "", 0)
'INTERNET_DEFAULT_HTTPS_PORT = 443
hSession = InternetConnect(hInstance, cboURL.Text, 443, _
"", "", INTERNET_SERVICE_HTTP, 0, 0)
hRequest = HttpOpenRequest(hSession, _
"GET", _
cboURL.Text, _
vbNullString, _
vbNullString, _
0, _
INTERNET_FLAG_SECURE, _
0)
lngRet = InternetQueryOptionA(hRequest, _
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT, _
Cert, _
0)
CertSize = Len(Cert)
lngRet = InternetQueryOptionA(hRequest, _
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT, _
Cert, _
CertSize)
MsgBox (Cert.lpszIssuerInfo)
MsgBox (Cert.ftStart)
End Sub