Web Service Call Using Digital Certificates

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Web Service Call Using Digital Certificates

    Hi,
    I tried posting this to the microsoft.public.dotnet.framework.aspnet group
    however I thought it might be more appropriate in this group.

    I am currently having a problem calling a web service that is secured using
    a digital certificate. I set up a Windows application to make a call to the
    service and it works fine. However when I make a call from my ASP.NET page
    it fails with "System.Net.WebException: The request failed with HTTP status
    403: Forbidden". The code that I am using to make the call in both
    instances is:
    MyWebService myService = new MyWebService();

    myService.ClientCertificates.Add(X509Certificate.C reateFromCertFile(@"C:\myC
    ert.cer"));

    myService.HelloWorld();

    I think the problem may be related to permissions. The Windows application
    runs using my account so I changed IIS to run as me as well. I have set
    <identity impersonate="true"> in the web.config and I have checked using my
    ASP.NET application that I am running under this account.

    The Root CA certificate is installed under the "Current User" and the "Local
    Computer" certificate stores and the client certificate is installed in both
    these stores as well.

    If anyone could help me solve this problem it would be great.

    Ben



    bs Guest

  2. Similar Questions and Discussions

    1. Error on call web service from asp.net whit certificates
      Hello to all. I am developing a web site that must be connectedto of the web service on protocol https. has created a testapplication windows form...
    2. SSL / Web Service requring client certificates. No certificate server side...?
      Hi all, I have the following scenario (XP / IIS 5, FX v1.1.4322) Both the client app and web service are running on my local development...
    3. digital certificates
      Hi, Does anyone know a good book or site for using digital certificates with asp thanks jonathan
    4. Windows Certificates as Digital Signatures????
      Is there a good reference for how to use windows certificates as the basis for an adobe digital signature. I have exported and imported just about...
    5. LWP using digital certificates
      Can someone point me to docs on how to use LWP and digital certificates! Much appreciated. THANKS PR
  3. #2

    Default Re: Web Service Call Using Digital Certificates

    If you are using 1.0 Version, there is a hotfix you could obtain through the
    support services. Please see the following URL
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;817854[/url]
    After applying the fix the system then looks for the certificate in
    the machine store in addition to the ASP.NET User account certificate store.
    One thing to make sure is that the ASP.NET account has access to the
    machine certificate store.






    "bs" <bens@no-spam-please.esd.nec.com.au> wrote in message
    news:1085718892.231756@proxy.nec.com.au...
    > Hi,
    > I tried posting this to the microsoft.public.dotnet.framework.aspnet group
    > however I thought it might be more appropriate in this group.
    >
    > I am currently having a problem calling a web service that is secured
    using
    > a digital certificate. I set up a Windows application to make a call to
    the
    > service and it works fine. However when I make a call from my ASP.NET
    page
    > it fails with "System.Net.WebException: The request failed with HTTP
    status
    > 403: Forbidden". The code that I am using to make the call in both
    > instances is:
    > MyWebService myService = new MyWebService();
    >
    >
    myService.ClientCertificates.Add(X509Certificate.C reateFromCertFile(@"C:\myC
    > ert.cer"));
    >
    > myService.HelloWorld();
    >
    > I think the problem may be related to permissions. The Windows
    application
    > runs using my account so I changed IIS to run as me as well. I have set
    > <identity impersonate="true"> in the web.config and I have checked using
    my
    > ASP.NET application that I am running under this account.
    >
    > The Root CA certificate is installed under the "Current User" and the
    "Local
    > Computer" certificate stores and the client certificate is installed in
    both
    > these stores as well.
    >
    > If anyone could help me solve this problem it would be great.
    >
    > Ben
    >
    >
    >

    Durgaprasad Gorti[MSFT] Guest

  4. #3

    Default Re: Web Service Call Using Digital Certificates

    Hi Durgaprasad,

    As the knowledge base article you referred to only relates to version 1.0 of
    the .NET Framework I decided to upgrade my machine to 1.1. After upgrading
    I attempted access the web service again however I still get the same error.
    The certificate is installed under the impersonated ASP.NET user account and
    is installed in the "Certificates(Local Computer)" store. I am assuming
    this is what you mean by the "machine certificate store". Unfortunately
    still no luck.
    Is it possible that this bug is still present in 1.1 of the framework?
    Also, I don't understand why the ASP.NET application doesn't throw an
    exception when it unsuccessfully attempts to access the certificate store.

    Thanks
    Ben

    "Durgaprasad Gorti[MSFT]" <dgorti@online.microsoft.com> wrote in message
    news:eOVnhDQREHA.3300@tk2msftngp13.phx.gbl...
    > If you are using 1.0 Version, there is a hotfix you could obtain through
    the
    > support services. Please see the following URL
    > [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;817854[/url]
    > After applying the fix the system then looks for the certificate in
    > the machine store in addition to the ASP.NET User account certificate
    store.
    > One thing to make sure is that the ASP.NET account has access to the
    > machine certificate store.
    >
    >
    >
    >
    >
    >
    > "bs" <bens@no-spam-please.esd.nec.com.au> wrote in message
    > news:1085718892.231756@proxy.nec.com.au...
    > > Hi,
    > > I tried posting this to the microsoft.public.dotnet.framework.aspnet
    group
    > > however I thought it might be more appropriate in this group.
    > >
    > > I am currently having a problem calling a web service that is secured
    > using
    > > a digital certificate. I set up a Windows application to make a call to
    > the
    > > service and it works fine. However when I make a call from my ASP.NET
    > page
    > > it fails with "System.Net.WebException: The request failed with HTTP
    > status
    > > 403: Forbidden". The code that I am using to make the call in both
    > > instances is:
    > > MyWebService myService = new MyWebService();
    > >
    > >
    >
    myService.ClientCertificates.Add(X509Certificate.C reateFromCertFile(@"C:\myC
    > > ert.cer"));
    > >
    > > myService.HelloWorld();
    > >
    > > I think the problem may be related to permissions. The Windows
    > application
    > > runs using my account so I changed IIS to run as me as well. I have set
    > > <identity impersonate="true"> in the web.config and I have checked using
    > my
    > > ASP.NET application that I am running under this account.
    > >
    > > The Root CA certificate is installed under the "Current User" and the
    > "Local
    > > Computer" certificate stores and the client certificate is installed in
    > both
    > > these stores as well.
    > >
    > > If anyone could help me solve this problem it would be great.
    > >
    > > Ben
    > >
    > >
    > >
    >
    >

    bs Guest

  5. #4

    Default Re: Web Service Call Using Digital Certificates

    I found the solution to this problem after escalating it to the Microsoft
    Support Division. The problem was solved when I granted the ASPNET user
    (Windows 2000) security privileges to the <drive>:\Documents and
    Settings\ApplicationData\Microsoft\Crypto\RSA folder. I also discovered
    that the certificate needs to be installed in the "Certificates (Local
    Machine)\Personal\Certificates" store. You can access this store through
    mmc, choose Console --> Add\Remove Snap-in --> Add --> Certificates -->
    Computer Account --> Local Computer.

    "Durgaprasad Gorti[MSFT]" <dgorti@online.microsoft.com> wrote in message
    news:eOVnhDQREHA.3300@tk2msftngp13.phx.gbl...
    > If you are using 1.0 Version, there is a hotfix you could obtain through
    the
    > support services. Please see the following URL
    > [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;817854[/url]
    > After applying the fix the system then looks for the certificate in
    > the machine store in addition to the ASP.NET User account certificate
    store.
    > One thing to make sure is that the ASP.NET account has access to the
    > machine certificate store.
    >
    >
    >
    >
    >
    >
    > "bs" <bens@no-spam-please.esd.nec.com.au> wrote in message
    > news:1085718892.231756@proxy.nec.com.au...
    > > Hi,
    > > I tried posting this to the microsoft.public.dotnet.framework.aspnet
    group
    > > however I thought it might be more appropriate in this group.
    > >
    > > I am currently having a problem calling a web service that is secured
    > using
    > > a digital certificate. I set up a Windows application to make a call to
    > the
    > > service and it works fine. However when I make a call from my ASP.NET
    > page
    > > it fails with "System.Net.WebException: The request failed with HTTP
    > status
    > > 403: Forbidden". The code that I am using to make the call in both
    > > instances is:
    > > MyWebService myService = new MyWebService();
    > >
    > >
    >
    myService.ClientCertificates.Add(X509Certificate.C reateFromCertFile(@"C:\myC
    > > ert.cer"));
    > >
    > > myService.HelloWorld();
    > >
    > > I think the problem may be related to permissions. The Windows
    > application
    > > runs using my account so I changed IIS to run as me as well. I have set
    > > <identity impersonate="true"> in the web.config and I have checked using
    > my
    > > ASP.NET application that I am running under this account.
    > >
    > > The Root CA certificate is installed under the "Current User" and the
    > "Local
    > > Computer" certificate stores and the client certificate is installed in
    > both
    > > these stores as well.
    > >
    > > If anyone could help me solve this problem it would be great.
    > >
    > > Ben
    > >
    > >
    > >
    >
    >

    bs Guest

  6. #5

    Default Re: Web Service Call Using Digital Certificates

    "bs" wrote:
    > Is it possible that this bug is still present in 1.1 of the framework?
    Yes it is and the article mentions to use the June 2003 Hotfix Rollup to get the fix applied to 1.1.

    [url]http://support.microsoft.com/default.aspx?kbid=821156[/url]

    Unfortunately this did not solve my problem.
    gardavis Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139