Websevice secured with X509 cert (ssl)

Discussion in 'ASP .Net Web Services' started by Bat'on, Feb 2, 2005.

  1. Bat'on

    Bat'on Guest

    Hi,

    I try to consume a webservice. In order to see it in IE, I needed to install
    (provided) X509 certs (I got 2 of them) When I try to open that page
    in IE, I'm being asked which cert I want to use, and page opens.

    Now when I try to add webreference in VS2K3, after i type url in that
    wizzard, I'm asked again to choose a cert. Then wsdl appears, but on
    the right side of the wizzard ("Web services found at that url") I see:

    There was an error downloading 'https://url/name.asmx?WSDL'.

    The request failed with HTTP status 403: Forbidden.

    Any chance to fix that?

    Second question. OK, I managed to add a webreference to other WS
    with the same WSDL, than I change url to that of secured webserwice.

    test.Url = "https://secured_url/";

    and add cert to client certificates using:

    test.ClientCertificates.Add(X509Certificate.CreateFromSignedFile(@"C:\test.pfx");

    But I still get:

    System.Net.WebException: The request failed with HTTP status 403: Forbidden.

    :-( Any hint? What am I doing wrong?

    Bat
     
    Bat'on, Feb 2, 2005
    #1
    1. Advertising

  2. Bat'on

    Bat'on Guest

    "Bat'on" wrote:

    > Hi,
    >
    > I try to consume a webservice. In order to see it in IE, I needed to install
    > (provided) X509 certs (I got 2 of them) When I try to open that page
    > in IE, I'm being asked which cert I want to use, and page opens.
    >
    > Now when I try to add webreference in VS2K3, after i type url in that
    > wizzard, I'm asked again to choose a cert. Then wsdl appears, but on
    > the right side of the wizzard ("Web services found at that url") I see:
    >
    > There was an error downloading 'https://url/name.asmx?WSDL'.
    >
    > The request failed with HTTP status 403: Forbidden.
    >
    > Any chance to fix that?
    >
    > Second question. OK, I managed to add a webreference to other WS
    > with the same WSDL, than I change url to that of secured webserwice.
    >
    > test.Url = "https://secured_url/";
    >
    > and add cert to client certificates using:
    >
    > test.ClientCertificates.Add(X509Certificate.CreateFromSignedFile(@"C:\test.pfx");
    >
    > But I still get:
    >
    > System.Net.WebException: The request failed with HTTP status 403: Forbidden.
    >
    > :-( Any hint? What am I doing wrong?


    OK, I know now what I was doing wrong. CreateFromSignedFile fails to create
    a cert without any notice. Neither it throws an exception, nor returns null.
    Its a
    cert with all fields undefined or null (except from type, witch is set to
    "X509" :)

    CreateFromSignedFile does it even if that file could not be found :D

    I switched to CreateFromCertFile, exported that cerificate to "cer" file
    and it works now...

    Bat
     
    Bat'on, Feb 2, 2005
    #2
    1. Advertising

  3. Bat'on

    JerryK Guest

    "Bat'on" <> wrote in message
    news:...
    > "Bat'on" wrote:
    >
    >> Hi,
    >>
    >> I try to consume a webservice. In order to see it in IE, I needed to
    >> install
    >> (provided) X509 certs (I got 2 of them) When I try to open that page
    >> in IE, I'm being asked which cert I want to use, and page opens.
    >>
    >> Now when I try to add webreference in VS2K3, after i type url in that
    >> wizzard, I'm asked again to choose a cert. Then wsdl appears, but on
    >> the right side of the wizzard ("Web services found at that url") I see:
    >>
    >> There was an error downloading 'https://url/name.asmx?WSDL'.
    >>
    >> The request failed with HTTP status 403: Forbidden.
    >>
    >> Any chance to fix that?
    >>
    >> Second question. OK, I managed to add a webreference to other WS
    >> with the same WSDL, than I change url to that of secured webserwice.
    >>
    >> test.Url = "https://secured_url/";
    >>
    >> and add cert to client certificates using:
    >>
    >> test.ClientCertificates.Add(X509Certificate.CreateFromSignedFile(@"C:\test.pfx");
    >>
    >> But I still get:
    >>
    >> System.Net.WebException: The request failed with HTTP status 403:
    >> Forbidden.
    >>
    >> :-( Any hint? What am I doing wrong?

    >
    > OK, I know now what I was doing wrong. CreateFromSignedFile fails to
    > create
    > a cert without any notice. Neither it throws an exception, nor returns
    > null.
    > Its a
    > cert with all fields undefined or null (except from type, witch is set to
    > "X509" :)
    >
    > CreateFromSignedFile does it even if that file could not be found :D
    >
    > I switched to CreateFromCertFile, exported that cerificate to "cer" file
    > and it works now...
    >
    > Bat
     
    JerryK, Mar 9, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    480
    Nicole Calinoiu
    May 15, 2006
  2. David Chan via .NET 247
    Replies:
    1
    Views:
    355
    Dominick Baier [DevelopMentor]
    Jun 2, 2005
  3. gardavis
    Replies:
    0
    Views:
    253
    gardavis
    Jul 2, 2004
  4. marc spitzer

    How do I decode/parse a X509 SSL Cert

    marc spitzer, Sep 3, 2009, in forum: Ruby
    Replies:
    2
    Views:
    231
    yermej
    Sep 4, 2009
  5. Daniel Frechette
    Replies:
    2
    Views:
    191
    Thomas 'PointedEars' Lahn
    Apr 10, 2006
Loading...

Share This Page