SqueakSSL on Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

SqueakSSL on Windows

Jon Hylands

Hi everyone,

I loaded SqueakSSL-Core-ar.22.mcz and SqueakSSL-Tests-ar-13.mcz from the Monticello repository http://www.squeaksource.com/SqueakSSL into a Squeak 4.2 All-in-One image directly from the squeak.org website (which has not been updated).

The following method: SqueakSSLTest >> #expectedFailures is implemented thusly:

expectedFailures
"If we don't have a cert all the tests fail"

SqueakSSL platformName = 'Mac OS' ifTrue:[
"The following tests all need certificate selection
to work properly."
^#(
testConnectAccept 
testEncryptDecrypt 
testMultiFrameDecrypt 
testSingleByteDecrypt
testSplitTlsFrameRead
testStreamAccept
testStreamConnect
testStreamTransfer
)
].


This clearly doesn't work on Windows at all, since TestCase >> #shouldPass sends #includes: to the result of that method, which (if you're not running Mac OS) is the SqueakSSLTest instance.

I added:

^super expectedFailures

at the bottom, and the tests at least don't choke before they start now.

Now the tests all fail. I grabbed the latest DLL from http://code.google.com/p/squeakssl/downloads/list, replaced the one that came with 4.2, and now all the tests pass :-)

I'm hoping to be able to send & receive email from a specific gmail account using this - any suggestions?

- Jon



Reply | Threaded
Open this post in threaded view
|

Re: SqueakSSL on Windows

Andreas.Raab
On 11/26/2011 17:55, Jon Hylands wrote:
> This clearly doesn't work on Windows at all, since TestCase >>
> #shouldPass sends #includes: to the result of that method, which (if
> you're not running Mac OS) is the SqueakSSLTest instance.

You're right, apologies. I don't know what I've been smoking when I
committed this version :-) It's fixed now.

> I'm hoping to be able to send & receive email from a specific gmail
> account using this - any suggestions?

For sending you can try the SqueakSSL-SMTP package which i just
committed to the SqueakSSL repository. This is just a subclassed
SMTPClient using SecureSocketStream for sending the email. The class
side example shows how to send Email from a GMail account.

POP3 should be similarly simple if you start from POP3Client.

Hope this helps,
   - Andreas



SecureSMTPClient.st (796 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSSL on Windows

Jon Hylands
Thanks Andreas,

That worked, although I'm obviously missing something you have in your image, since SecureSocketStream doesn't implement openConnectionToHost:port:timeout:, only openConnectionToHost:port:. I just removed the timeout argument altogether, using the default timeout, and it works fine with that.

I tried the POP3Client, but gmail requires an SSL connection, so I copied your ensureConnection method to a new subclass, SecurePOP3Client (see attached) that works nicely.

Note that the example attempts to delete the message after downloading, which of course is nice to have in an automated system, but you probably wouldn't want to do it on your "real" gmail account. In order for the delete to work, you have to change the setting on the gmail account settings to delete after download. I also had to add a #quit in addition to the #close in order to have the server flush and properly do the delete.

- Jon


On Sun, Nov 27, 2011 at 5:42 AM, Andreas Raab <[hidden email]> wrote:
On 11/26/2011 17:55, Jon Hylands wrote:
This clearly doesn't work on Windows at all, since TestCase >>
#shouldPass sends #includes: to the result of that method, which (if
you're not running Mac OS) is the SqueakSSLTest instance.

You're right, apologies. I don't know what I've been smoking when I committed this version :-) It's fixed now.


I'm hoping to be able to send & receive email from a specific gmail
account using this - any suggestions?

For sending you can try the SqueakSSL-SMTP package which i just committed to the SqueakSSL repository. This is just a subclassed SMTPClient using SecureSocketStream for sending the email. The class side example shows how to send Email from a GMail account.

POP3 should be similarly simple if you start from POP3Client.

Hope this helps,
 - Andreas







SecurePOP3Client.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSSL on Windows

Andreas.Raab
On 11/28/2011 2:44, Jon Hylands wrote:
> Thanks Andreas,
>
> That worked, although I'm obviously missing something you have in your
> image, since SecureSocketStream doesn't
> implement openConnectionToHost:port:timeout:,
> only openConnectionToHost:port:. I just removed the timeout argument
> altogether, using the default timeout, and it works fine with that.

SocketStream implements openConnectionToHost:port:timeout: and
SecureSocketStream is a subclass of it, so the method should be there.

Cheers,
   - Andreas

> I tried the POP3Client, but gmail requires an SSL connection, so I
> copied your ensureConnection method to a new subclass, SecurePOP3Client
> (see attached) that works nicely.
>
> Note that the example attempts to delete the message after downloading,
> which of course is nice to have in an automated system, but you probably
> wouldn't want to do it on your "real" gmail account. In order for the
> delete to work, you have to change the setting on the gmail account
> settings to delete after download. I also had to add a #quit in addition
> to the #close in order to have the server flush and properly do the delete.
>
> - Jon
>
>
> On Sun, Nov 27, 2011 at 5:42 AM, Andreas Raab <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On 11/26/2011 17:55, Jon Hylands wrote:
>
>         This clearly doesn't work on Windows at all, since TestCase >>
>         #shouldPass sends #includes: to the result of that method, which (if
>         you're not running Mac OS) is the SqueakSSLTest instance.
>
>
>     You're right, apologies. I don't know what I've been smoking when I
>     committed this version :-) It's fixed now.
>
>
>         I'm hoping to be able to send & receive email from a specific gmail
>         account using this - any suggestions?
>
>
>     For sending you can try the SqueakSSL-SMTP package which i just
>     committed to the SqueakSSL repository. This is just a subclassed
>     SMTPClient using SecureSocketStream for sending the email. The class
>     side example shows how to send Email from a GMail account.
>
>     POP3 should be similarly simple if you start from POP3Client.
>
>     Hope this helps,
>       - Andreas
>
>
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: SqueakSSL on Windows

Jon Hylands
If you pull a virgin 4.2 All-in-one image off squeak.org, you'll see that that method does not exist anywhere in the image, so it obviously came from some other package...

- Jon


On Tue, Nov 29, 2011 at 3:24 AM, Andreas Raab <[hidden email]> wrote:
On 11/28/2011 2:44, Jon Hylands wrote:
Thanks Andreas,

That worked, although I'm obviously missing something you have in your
image, since SecureSocketStream doesn't
implement openConnectionToHost:port:timeout:,
only openConnectionToHost:port:. I just removed the timeout argument
altogether, using the default timeout, and it works fine with that.

SocketStream implements openConnectionToHost:port:timeout: and SecureSocketStream is a subclass of it, so the method should be there.

Cheers,
 - Andreas

I tried the POP3Client, but gmail requires an SSL connection, so I
copied your ensureConnection method to a new subclass, SecurePOP3Client
(see attached) that works nicely.

Note that the example attempts to delete the message after downloading,
which of course is nice to have in an automated system, but you probably
wouldn't want to do it on your "real" gmail account. In order for the
delete to work, you have to change the setting on the gmail account
settings to delete after download. I also had to add a #quit in addition
to the #close in order to have the server flush and properly do the delete.

- Jon


On Sun, Nov 27, 2011 at 5:42 AM, Andreas Raab <[hidden email]
<mailto:[hidden email]>> wrote:

   On 11/26/2011 17:55, Jon Hylands wrote:

       This clearly doesn't work on Windows at all, since TestCase >>
       #shouldPass sends #includes: to the result of that method, which (if
       you're not running Mac OS) is the SqueakSSLTest instance.


   You're right, apologies. I don't know what I've been smoking when I
   committed this version :-) It's fixed now.


       I'm hoping to be able to send & receive email from a specific gmail
       account using this - any suggestions?


   For sending you can try the SqueakSSL-SMTP package which i just
   committed to the SqueakSSL repository. This is just a subclassed
   SMTPClient using SecureSocketStream for sending the email. The class
   side example shows how to send Email from a GMail account.

   POP3 should be similarly simple if you start from POP3Client.

   Hope this helps,
     - Andreas












Reply | Threaded
Open this post in threaded view
|

Re: SqueakSSL on Windows

Levente Uzonyi-2
On Tue, 29 Nov 2011, Jon Hylands wrote:

> If you pull a virgin 4.2 All-in-one image off squeak.org, you'll see that
> that method does not exist anywhere in the image, so it obviously came from
> some other package...

It was introduced in Squeak 4.3, see
http://lists.squeakfoundation.org/pipermail/squeak-dev/2011-March/157820.html