[squeak-dev] Zodiac - 2nd delivery - A new (binary) secure socket stream + Zn clients doing HTTPS

Sven Van Caekenberghe sven at beta9.be
Wed May 18 14:53:27 UTC 2011


Hi,

Here is the second delivery of Zodiac: A new (binary) secure socket stream and the ability of the Zinc HTTP Components clients to do HTTPS.

Warning: this is of course not yet code for general consumption, use the source and the comments. This is a proof of concept.

ZdcSecureSocketStream, a subclass of ZdcOptimizedSocketStream was added. This implementation works together with both a Socket and with a ZdcAbstractSSLSession object, of which there is currently one implementation, ZdcPluginSSLSession.

Loading this code is safe, to make it work though, you need to add a plugin to your VM.

Please go to 

	http://code.google.com/p/squeakssl/ 

and download the apropriate plugin for your platform and put it next to the other plugins. Disclaimer: I only tested on Mac OS X, but the plugin should work on the other platforms. The Smalltalk code works on Pharo 1.2 and 1.3 as well as on Squeak 4.2 with any modifications.

There is currently just one simple test in Zodiac itself.

What is nicer though, is the fact the Zinc HTTP Components clients can now do HTTPS !

Load the latest version of Zinc-Zodiac from the ZincHTTPComponents repository and enable the socket stream factory:

	ZnNetworkingUtils default: ZnZodiacNetworkingUtils new. 

Tada: you should now be able to do any of the following

	ZnClient get: 'https://encrypted.google.com/search?q=Smalltalk' 
	ZnHttpClient new get: 'https://www.gmail.com' 
	ZnHttpClient new get: 'https://secure.wikimedia.org/' 
	ZnHttpClient new get: 'http://gforge.inria.fr/frs/?group_id=1299' 
	ZnHttpClient new get: 'https://www.paypal.com' 
	ZnClient get: 'https://aws.amazon.com/' 

These are all part of ZnHTTPSTests.

(The difference between ZnClient and ZnHttpClient is that the latter has more options, follows redirects, deals with cookies, ..).

When you have Zinc-Patch-HTTPSocket loaded (which is the case in Pharo 1.3 Core and derivatives) the legacy interface will work as well:

	HTTPSocket httpGet: 'https://encrypted.google.com/search?q=Smalltalk'

Please note that certificate management or checking the server's certificate or hostname is not yet supported. There will probably be many use cases that give errors. If you have examples that I can easily reproduce, please let me know.

There is still a good way to go, but I think this is an important step.

Sven




More information about the Squeak-dev mailing list