Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Silverlight 2.0 Secure Webservices SSL RSS

5 replies

Last post Apr 17, 2008 10:27 AM by heralight

(0)
  • JoshuaHardy

    JoshuaHardy

    Member

    12 Points

    8 Posts

    Silverlight 2.0 Secure Webservices SSL

    Mar 26, 2008 04:07 PM | LINK

    Is it possible to call https services from within Silverlight?  If so, how is this done?

    My initial thought was to develop both the web service and Silverlight control simultaneously, once published to a web server to simply install a certificate and switch from http to https, this doesn't work for me.  Seems, almost logical that it wouldn't being that I consume my service through the auto-generated proxy from within visual studio, this proxy will point to the http, not the https.

    I switched to developing the web service and control independently.  Upon enabling the SSL certificate on the web-service, I was no longer able to consume it.  I figured this to be caused by having an http hosted Silverlight control attempting to access a https service.  The next logical step was to enable the SSL certificate on the Silverlight control host directory, I figured if my Silverlight control was using https and my web service was using https(using the same certificate), they would be able to communicate. I was wrong.  So now I'm stumped, please help.
     
    There has got to be a way to secure the communication of sensitive data.  In advance I'd like to thank you for your help.
     

    Silverlight 2.0 Secure Webservices SSL

  • JohnSpurlock

    JohnSpurlock

    Member

    94 Points

    28 Posts

    Re: Silverlight 2.0 Secure Webservices SSL

    Mar 26, 2008 07:54 PM | LINK

    You can either make https calls to the same domain or http cross-domain calls, but not https cross-domain calls.



    This is described in http://msdn2.microsoft.com/en-us/library/cc189008(VS.95).aspx

    (see "If not HTTPS" in the matrix)


    Hope that helps,
    - John 

  • logicasw

    logicasw

    Member

    50 Points

    25 Posts

    Re: Silverlight 2.0 Secure Webservices SSL

    Mar 26, 2008 08:06 PM | LINK

     

    JohnSpurlock

    You can either make https calls to the same domain or http cross-domain calls, but not https cross-domain calls.


    This is described in http://msdn2.microsoft.com/en-us/library/cc189008(VS.95).aspx

    (see "If not HTTPS" in the matrix)

    I checked the reference but is not accurate since WebClient() can do cross-domain in http when crossdomain.xml is present.

    I still wondering why not cross-domain in https nor cross-schema http->https.

    Regards. 

  • heralight

    heralight

    Member

    49 Points

    30 Posts

    Re: Silverlight 2.0 Secure Webservices SSL failed (without cross domain call) but works in WPF

    Apr 16, 2008 09:48 AM | LINK

     I Have same problem,

     Without any cross domain in silverlight, I can't to my HTTPS web service. In Winform and in WPF it works with ServicePointManager.ServerCertificateValidationCallback += ServerCertificateValidationCallback;

    But this callback doesn't exist in silverlight beta1.

    Can you say me if in beta 2 we can use this HTTPS Web Service, and for socket port if we can call 80 and support ssl socket ?
     

    Regards,

     

    Alexandre

     

    --
    Please mark the posts as answers if they help and unmark if they don't.
    http://www.hera.cc
  • SpoonStomper

    SpoonStomper

    Member

    114 Points

    38 Posts

    Re: Silverlight 2.0 Secure Webservices SSL failed (without cross domain call) but works in WPF

    Apr 16, 2008 04:33 PM | LINK

    If your intital access to the silverlight app was via SSL, ie: https://youdomain.com/silverlighthostpage.aspx/. Couldn't you just use releative URI's to call back to the webservices and automatically be inside the SSL?

    Just a shot in the dark...

  • heralight

    heralight

    Member

    49 Points

    30 Posts

    Re: Silverlight 2.0 Secure Webservices SSL failed (without cross domain call) but works in WPF

    Apr 17, 2008 10:27 AM | LINK

    I would like, but to access to web service in silverlight beta 1, as I understand, we must create an EndPointAddress and a BasicHTTPBinding object (explicitly or implicitly in Add service reference) that why I can't directly access to the main browser ssl connection through web service instance.

    For example :

    My silverlight is download from https://www.mock.com/jws/silverlight/test.html

    my  web service is  https://www.mock.com/jws/ws

    I need to do:

                Binding bd = new BasicHttpBinding();
      EndpointAddress address = new EndpointAddress("https://www.mock.com/jws/ws");

    myWebService = new WSClient(bd, address); 

    In this case, in SSL, client doesn't understand server... because my web service instance doesn't have any certificate X509 or doesn't accept it. 

     

     Any Idea... ? [:P]


     Alexandre

     

     

    --
    Please mark the posts as answers if they help and unmark if they don't.
    http://www.hera.cc