Discussion:
WinHttpRequestClass.Send [ A security error occurred]
(too old to reply)
John1
2004-08-16 22:39:38 UTC
Permalink
I m running application on 2003 server. Application throw an exception
while sending data to other server "req.Send(reqXML);"
ErrorMessage: "A security error occurred", no other information. Why its
happening ?
same code is running fine on XP...

Code ....
req = new WinHttp.WinHttpRequestClass();

req.Open("POST", sProviderURL , false);
req.SetClientCertificate("LOCAL_MACHINE\\Root\\MY");
req.Send(reqXML);

Any solution or workaround to fix this problem?

Thanks
John
Biao Wang [MSFT]
2004-08-17 05:15:01 UTC
Permalink
Hi John,

Are you running the code below inside an ASP page? Note that there are some
IIS behavior changes between XP and 2003 which may explain the error you are
seeing. Please review this earlier posting to see whether that's the case.

http://groups.google.com/groups?q=ASP+SSL+ISSUE&hl=en&lr=&ie=UTF-8&c2coff=1&selm=A0F833C8-DAC0-4BD3-B6BF-DB4BD672150A%40microsoft.com&rnum=1

Also your code is telling WinHttp to find a cert certificate named "MY" in
the root store, is that the true intention? Typically "MY" is a store name,
not cert name.

Hope this helps,
Biao.W.

This posting is provided "AS IS" with no warranties, and confers no rights.
Post by John1
I m running application on 2003 server. Application throw an exception
while sending data to other server "req.Send(reqXML);"
ErrorMessage: "A security error occurred", no other information. Why its
happening ?
same code is running fine on XP...
Code ....
req = new WinHttp.WinHttpRequestClass();
req.Open("POST", sProviderURL , false);
req.SetClientCertificate("LOCAL_MACHINE\\Root\\MY");
req.Send(reqXML);
Any solution or workaround to fix this problem?
Thanks
John
John
2004-08-18 22:20:31 UTC
Permalink
Thanks for quick response:
Application is developed in ASP.net 1.1 and using winhttp 1.1 and
Certificate Name is MyCert. Already assign client certificate access
permission to ASPNET using winhttpcertcfg.
And works fine on XP but problem with 2003 server. can you tell me how
to assign client certificate permission to Network Service?
Thanks
John

req = new WinHttp.WinHttpRequestClass();

req.Open("POST", sProviderURL , false);
req.SetClientCertificate("LOCAL_MACHINE\\Root\\MyCert");
req.Send(reqXML);
Post by Biao Wang [MSFT]
Hi John,
Are you running the code below inside an ASP page? Note that there are some
IIS behavior changes between XP and 2003 which may explain the error you are
seeing. Please review this earlier posting to see whether that's the case.
http://groups.google.com/groups?q=ASP+SSL+ISSUE&hl=en&lr=&ie=UTF-8&c2coff=1&selm=A0F833C8-DAC0-4BD3-B6BF-DB4BD672150A%40microsoft.com&rnum=1
Also your code is telling WinHttp to find a cert certificate named "MY" in
the root store, is that the true intention? Typically "MY" is a store name,
not cert name.
Hope this helps,
Biao.W.
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by John1
I m running application on 2003 server. Application throw an exception
while sending data to other server "req.Send(reqXML);"
ErrorMessage: "A security error occurred", no other information. Why its
happening ?
same code is running fine on XP...
Code ....
req = new WinHttp.WinHttpRequestClass();
req.Open("POST", sProviderURL , false);
req.SetClientCertificate("LOCAL_MACHINE\\Root\\MY");
req.Send(reqXML);
Any solution or workaround to fix this problem?
Thanks
John
Biao Wang [MSFT]
2004-08-20 07:05:03 UTC
Permalink
try

winhttpcertcfg -g -c LOCAL_MACHINE\Root -s MyCert -a NetworkService

you should confirm your app is indeed running as Network Service --

1) Open the IIS MMC span-in (Start, Run,
“%SystemRoot%\system32\inetsrv\iis.msc”)
2) Expand “Application Pools”, right-click on DefaultAppPool, select
Properties and then click on the “Identity” tab

Hope this helps,
Biao.W. [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Post by John
Application is developed in ASP.net 1.1 and using winhttp 1.1 and
Certificate Name is MyCert. Already assign client certificate access
permission to ASPNET using winhttpcertcfg.
And works fine on XP but problem with 2003 server. can you tell me how
to assign client certificate permission to Network Service?
Thanks
John
req = new WinHttp.WinHttpRequestClass();
req.Open("POST", sProviderURL , false);
req.SetClientCertificate("LOCAL_MACHINE\\Root\\MyCert");
req.Send(reqXML);
Post by Biao Wang [MSFT]
Hi John,
Are you running the code below inside an ASP page? Note that there are some
IIS behavior changes between XP and 2003 which may explain the error you are
seeing. Please review this earlier posting to see whether that's the case.
http://groups.google.com/groups?q=ASP+SSL+ISSUE&hl=en&lr=&ie=UTF-8&c2coff=1&selm=A0F833C8-DAC0-4BD3-B6BF-DB4BD672150A%40microsoft.com&rnum=1
Also your code is telling WinHttp to find a cert certificate named "MY" in
the root store, is that the true intention? Typically "MY" is a store name,
not cert name.
Hope this helps,
Biao.W.
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by John1
I m running application on 2003 server. Application throw an exception
while sending data to other server "req.Send(reqXML);"
ErrorMessage: "A security error occurred", no other information. Why its
happening ?
same code is running fine on XP...
Code ....
req = new WinHttp.WinHttpRequestClass();
req.Open("POST", sProviderURL , false);
req.SetClientCertificate("LOCAL_MACHINE\\Root\\MY");
req.Send(reqXML);
Any solution or workaround to fix this problem?
Thanks
John
Loading...