today I want to send a request over https using a client certificate and it fails, returning the error message "cannot find object or property"
I get the error when calling the waitforresponse-method
can you help me as to what is causing this?
- something wrong with the clientcertificate?
- can I call waitforresponse when sending request over https? if not, why?
thanks in advance
here's the code:
'set request object
Set objHTTPRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
'open a request
objHTTPRequest.Open "POST", strURL, True 'true = async
'set request header
objHTTPRequest.SetRequestHeader "Content-Type", "text/xml"
'set client certificate
objHTTPRequest.SetClientCertificate strClientCertificate
'set userid and password
objHTTPRequest.SetCredentials strUserID, strPassword, 0
'0 : HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
'1 : HTTPREQUEST_SETCREDENTIALS_FOR_PROXY
'send request
objHTTPRequest.Send strXMLSent
'wait for as long as necessary
If objHTTPRequest.WaitForResponse(intRequestTimeOut) Then
'call returned before timeout expired
If objHTTPRequest.Status = HTTP_STATUS_OK Then
End If
End If
How and where did you install the client certificate? You can use the
WinHttpCertCfg utility to verify that your client certificate is installed
properly. For a COM+ component, the certificate should be located in the
Personal certificate store of the Local Machine user account. If the name of
your certificate is "ClientCert", for example, then the strClientCertificate
string should be "LOCAL_MACHINE\MY\ClientCert". ("MY" in the client cert
string specifies the Personal store.) In addition, access to the
certificate must be granted to the user account under which your COM+
component runs. You can use WinHttpCertCfg.exe to install and configure a
client certificate.
Documentation for the WinHttpCertCfg tool:
WinHttpCertCfg is available with the Windows Server 2003 Resource Toolkit.
(You can use WinHttpCertCfg.exe on Windows 2000 and XP as well as Server
2003.)
Also note that if you are using an SSL client certificate to authenticate
with the server, then you probably do not need to call the SetCredentials
method. The certificate will be used for authentication, and not your UserID
and Password strings.
Stephen
"Steven Luyckx" <anon...@discussions.microsoft.com> wrote in message
news:1387A90F-E238-45C0...@microsoft.com...
That error message is a generic error reported by the SCHANNEL security
subsystem. The error code (converted to hexadecimal) is 0x80090327 -
SEC_E_CERT_UNKNOWN. You should check in the Event Viewer to see if there is
a more detailed error report.
If you Google the newsgroups for "unknown error occurred while processing
the certificate" you should find a number of other people struggling with
this error code. There seem to be multiple causes for it. It is likely that
the certificate is still not installed and configured properly, but do check
the Event Viewer. Try uninstalling and reinstalling the certificate. If you
used winhttpcertcfg.exe to install the cert, then try using the Certificates
MMC snap-in tool to do the install, and then use winhttpcertcfg.exe to
configure access permissions for the cert. (I don't think the Certificates
MMC tool can manage the access permissions of the certificate
unfortunately--that's why the winhttpcertcfg.exe utility was created.)
For information about the Certificates MMC tool, see:
http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/sag_CMprocsMngCompCerts.asp
You should also ask on the microsoft.public.platformsdk.security newsgroup
for help with this problem.
Good luck.
Stephen
"Steven Luyckx" <anon...@discussions.microsoft.com> wrote in message
news:3776BFA0-3B91-4365...@microsoft.com...
> Hey Stephen,
>
> Thanks for your suggestions. They helped me identify the problem.
> I reinstalled the certificate and now everything is displayed as expected
when using the winhttpcertcfg.
>
> Yet, another problem popped up, at the same location in my
script: -2146893017, "An unknown error occurred while processing the
certificate".
>
> The location of my certificate is under LOCAL_MACHINE\MY and the user
account under which COM+ runs has been granted access.
>
> Any ideas?
>
> Thanks.
> Steven.
>
> ----- Stephen Sulzer wrote: -----