7

I can't find a definitive answer on this, but a the moment I'm guessing not. If not, is there any possible workaround other than proxying via a server?

By way of interest, I'm just trying to connect to Gmail imap for a small test application...

jweyrich
  • 31,198
  • 5
  • 66
  • 97
LJW
  • 2,378
  • 1
  • 21
  • 35

3 Answers3

8

No, WP7.1 does not support SSL sockets.

Edit
Typically you would use SslStream to implement SSL over TCP. Unfortunately, SslStream is not available in Silverlight or WP7. You have to roll your own (which is a bad idea, but possible), or use a third party library.

As mentioned by Eugene, there's SecureBlackbox, but that's more than a thousand dollars (minimum, depending on your many license choices) to use in a commercial product. If you're doing this on your own, that's probably too big an upfront cost. If you're doing this for your company, it might be a route to consider.

Another option might be to try to use BouncyCastle in WP7, however BouncyCastle doesn't currently release WP7 compatible binaries and may rely on framework items not available in WP7. This blog entry implies it might be possible, but will require some tweaking.

If you're a solo dev, I'd recommend at least trying BouncyCastle before considering SecureBlackbox. If you're doing your company's WP7 app offering, start with SecureBlackbox.

Randolpho
  • 55,384
  • 17
  • 145
  • 179
  • Are you sure? SSL is important for secure communication on Internet and it would be a disaster if Windows Phone doesn't support it. – Jonas Nov 21 '11 at 19:00
  • 3
    Yes, I'm sure. WP7 doesn't offer SSL sockets. You can do HTTPS over WCF, but you cannot do SSL over sockets. – Randolpho Nov 21 '11 at 20:18
4

Our SecureBlackbox offers SSL support: you can use SSL engine with any transport (including sockets and pigeon mail) or you can use socket-based client component. There's a WP7-specific problem with certificate validation though - as WP7 doesn't let us access system certificates, you would need to have trusted certificates list in your application. Not a big problem with our components (SecureBlackbox includes complete certificate management as well), but you need to be aware about this extra step.

As far as I know, IPWorks by /n Software is offered for Windows Phone Mango, but I don't know exactly what they offer in SSL aspect.

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
  • Given that SslStream is not available in Silverlight or WP7, this may be the best option. I hate directing people toward a commercial product, but OP may have to shell out over a grand if he really wants SSL and doesn't want to roll his own. – Randolpho Nov 21 '11 at 20:32
  • I work for /n software. Our Windows Phone toolkits support a variety of SSL options including FTPS, HTTPS, IMAP/POP/SMTP over SSL, etc. You can find info on this [here](http://www.nsoftware.com/ipworks/ssl/) – Briggs Jul 24 '13 at 17:04
2

I did get Bouncy Castle compiling for CF 3.5 - it's probably not a stretch to use that work for Windows Phone.

Internally we've been using an internal port of OpenSSL for Compact Framework apps for ages, and it wasn't a difficult port. I suspect getting that working under Phone also wouldn't be overly difficult.

Community
  • 1
  • 1
ctacke
  • 66,480
  • 18
  • 94
  • 155
  • I actually like the idea of porting OpenSSL over either of the options I presented. +1 :) – Randolpho Nov 22 '11 at 00:09
  • Yeah, I really should get around to Codeplexing that work - been on my to-do list for about 4 years now.... – ctacke Nov 22 '11 at 02:02
  • Just like every other project I "do". :) – Randolpho Nov 22 '11 at 02:06
  • Thanks - I'm going to give Bouncy Castle a crack first, and if that fails then perhaps look at OpenSSL... but I assume if I can't get the former working then the latter won't be worth attempting! – LJW Nov 23 '11 at 10:22