Trouble sending secure email using vwnc 7.9

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

Trouble sending secure email using vwnc 7.9

Roger Whitney-2
I am trying to send email through Googles servers using vwnc 7.9. I had this working in vwnc 7.6. Below is the code I am using in 7.9 (with username and password modified). In the 'smtpClient connect' method I first get a dialog that states 'CA Not in Trust Registry' which gives me the option of 'Yes'  or 'No'. Either option gives an exception 'External object not found'. I have attached a trace of the exception. Anyone know how to solve this?

Not sure if it is related my machine has  '0.9.8r release' version of libcrypto.dylib. Actually I also have version 1.0.x of the libcrypto.dylib but it is in /opt/local/lib/ and I don't know how to get the Xtreams-Crypto package to use libcrypto in that location.


        smtpClient := SMTPClient host: 'smtp.gmail.com' port: 465.
        smtpClient user: (NetUser username: 'myGmailaddress'
                                password: 'mypassword').
        smtpClient useAuthentication: true.
        smtpClient useSecureConnection.
       
        message := MailMessage newTextPlain.
        message charset: MimeTypeDescriptor iso8859x1.
        message from: 'myGmailaddress'.
        message date: Timestamp now.
        message
                to: '[hidden email]';
                subject: 'portal test';
                text: 'test'.
        [smtpClient connect]
                on: Xtreams.TLSBadCertificate
                do:
                        [:ex |
                        Transcript show: ex printString.
                        ex proceed].
        [smtpClient send: message.
        Transcript show: 'Mail Sent']
                on: Error
                do:
                        [:exception |
                        Transcript
                                show: 'Error in sending email to: ';
                                cr;
                                show: exception printString;
                                cr;
                                show: exception messageText;
                                cr]



----
Roger Whitney              Department of Computer Science
[hidden email]        San Diego State University
http://www.eli.sdsu.edu/   San Diego, CA 92182-7720




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

externalObjectStackTrace.zip (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trouble sending secure email using vwnc 7.9

mkobetic
Yes this seems to be the case that VW is picking up the older version that doesn't provide the public key algorithm APIs that we need. There are two options available here, you can either help VW find the 1.0.0 library, either by modifying the definition in Xtreams.LibCryptoEVP class>>#libcryptoDylib or by defining environment variable VW_LIBCRYPTO.

Another option is to try loading package Security-Xtreams which should allow transparent failover to the smalltalk implementations of the public key ciphers. In 7.9 it works only for the public key algorithms, 7.10 can do that for all types of cryptographic algorithms.

HTH,

Martin

"Roger Whitney"<[hidden email]> wrote:

> I am trying to send email through Googles servers using vwnc 7.9. I had this working in vwnc 7.6. Below is the code I am using in 7.9 (with username and password modified). In the 'smtpClient connect' method I first get a dialog that states 'CA Not in Trust Registry' which gives me the option of 'Yes'  or 'No'. Either option gives an exception 'External object not found'. I have attached a trace of the exception. Anyone know how to solve this?
>
> Not sure if it is related my machine has  '0.9.8r release' version of libcrypto.dylib. Actually I also have version 1.0.x of the libcrypto.dylib but it is in /opt/local/lib/ and I don't know how to get the Xtreams-Crypto package to use libcrypto in that location.
>
>
> smtpClient := SMTPClient host: 'smtp.gmail.com' port: 465.
> smtpClient user: (NetUser username: 'myGmailaddress'
> password: 'mypassword').
> smtpClient useAuthentication: true.
> smtpClient useSecureConnection.
>
> message := MailMessage newTextPlain.
> message charset: MimeTypeDescriptor iso8859x1.
> message from: 'myGmailaddress'.
> message date: Timestamp now.
> message
> to: '[hidden email]';
> subject: 'portal test';
> text: 'test'.
> [smtpClient connect]
> on: Xtreams.TLSBadCertificate
> do:
> [:ex |
> Transcript show: ex printString.
> ex proceed].
> [smtpClient send: message.
> Transcript show: 'Mail Sent']
> on: Error
> do:
> [:exception |
> Transcript
> show: 'Error in sending email to: ';
> cr;
> show: exception printString;
> cr;
> show: exception messageText;
> cr]
>
>
>
> ----
> Roger Whitney              Department of Computer Science
> [hidden email]        San Diego State University
> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
>
>
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Trouble sending secure email using vwnc 7.9

mkobetic
In reply to this post by Roger Whitney-2
"Roger Whitney"<[hidden email]> wrote:
> thanks for the response, however none of the suggestions worked.
>
> When I modified Xtreams.LibCryptoEVP class>>#libcryptoDylib and then tried Xtreams.LibCryptoEVP class>>versionString I got an error saying it could not find the library. I tried the absolute path /opt/local/lib/libcrypto.dylib and relative path from the directory that contains the default library. How does one specify the location?

Yes, a full path should do it. Could it be that the file isn't readable or some such? Does something like '/opt/local/lib/libcrypto.dylib' asFilename exists work?

> I had the same problem when defining environment variable VW_LIBCRYPTO. Of course if the path I give in #libcryptoDylib does not work then the same path should not work with using the environment variable.

Yes, I would expect the same result as above with the env-var set the same way.

> When I loaded the Security-Xtreams package I get the same behavior that I described in the original email.

Hm, it sounds like for some reason the failover isn't kicking in. It's driven by the selection mechanism on the class side of PublicKey/PrivateKey. What does the following return in your image?

        PrivateKey selectImplementationFor: #RSA

The selection process is ultimately driven by the pragma adorned methods on concrete subclasses. The bodies of those methods define the conditions under which they apply and the pragma argument defines the selection priority the class is given if the condition is satisfied.

>
> On Jan 15, 2013, at 8:15 AM, [hidden email] wrote:
>
> > Yes this seems to be the case that VW is picking up the older version that doesn't provide the public key algorithm APIs that we need. There are two options available here, you can either help VW find the 1.0.0 library, either by modifying the definition in Xtreams.LibCryptoEVP class>>#libcryptoDylib or by defining environment variable VW_LIBCRYPTO.
> >
> > Another option is to try loading package Security-Xtreams which should allow transparent failover to the smalltalk implementations of the public key ciphers. In 7.9 it works only for the public key algorithms, 7.10 can do that for all types of cryptographic algorithms.
> >
> > HTH,
> >
> > Martin
> >
> > "Roger Whitney"<[hidden email]> wrote:
> >> I am trying to send email through Googles servers using vwnc 7.9. I had this working in vwnc 7.6. Below is the code I am using in 7.9 (with username and password modified). In the 'smtpClient connect' method I first get a dialog that states 'CA Not in Trust Registry' which gives me the option of 'Yes'  or 'No'. Either option gives an exception 'External object not found'. I have attached a trace of the exception. Anyone know how to solve this?
> >>
> >> Not sure if it is related my machine has  '0.9.8r release' version of libcrypto.dylib. Actually I also have version 1.0.x of the libcrypto.dylib but it is in /opt/local/lib/ and I don't know how to get the Xtreams-Crypto package to use libcrypto in that location.
> >>
> >>
> >> smtpClient := SMTPClient host: 'smtp.gmail.com' port: 465.
> >> smtpClient user: (NetUser username: 'myGmailaddress'
> >> password: 'mypassword').
> >> smtpClient useAuthentication: true.
> >> smtpClient useSecureConnection.
> >>
> >> message := MailMessage newTextPlain.
> >> message charset: MimeTypeDescriptor iso8859x1.
> >> message from: 'myGmailaddress'.
> >> message date: Timestamp now.
> >> message
> >> to: '[hidden email]';
> >> subject: 'portal test';
> >> text: 'test'.
> >> [smtpClient connect]
> >> on: Xtreams.TLSBadCertificate
> >> do:
> >> [:ex |
> >> Transcript show: ex printString.
> >> ex proceed].
> >> [smtpClient send: message.
> >> Transcript show: 'Mail Sent']
> >> on: Error
> >> do:
> >> [:exception |
> >> Transcript
> >> show: 'Error in sending email to: ';
> >> cr;
> >> show: exception printString;
> >> cr;
> >> show: exception messageText;
> >> cr]
> >>
> >>
> >>
> >> ----
> >> Roger Whitney              Department of Computer Science
> >> [hidden email]        San Diego State University
> >> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> vwnc mailing list
> >> [hidden email]
> >> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
> >>
> >
>
>
> ----
> Roger Whitney              Department of Computer Science
> [hidden email]        San Diego State University
> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
>
>
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Trouble sending secure email using vwnc 7.9

Roger Whitney-2
The answers to the questions you asked are:

"'/opt/local/lib/libcrypto.dylib' asFilename exists" returns true so VW sees the file. libcrypto.dylib is a link to the actual file. I tried to give the full path to the actual file but Xtreams.LibCryptoEVP class>>versionString claims it could not file that version either.

"PrivateKey selectImplementationFor: #RSA" returns the Xtreams.SecurityPrivateKey class

On Jan 17, 2013, at 2:11 PM, [hidden email] wrote:

> "Roger Whitney"<[hidden email]> wrote:
>> thanks for the response, however none of the suggestions worked.
>>
>> When I modified Xtreams.LibCryptoEVP class>>#libcryptoDylib and then tried Xtreams.LibCryptoEVP class>>versionString I got an error saying it could not find the library. I tried the absolute path /opt/local/lib/libcrypto.dylib and relative path from the directory that contains the default library. How does one specify the location?
>
> Yes, a full path should do it. Could it be that the file isn't readable or some such? Does something like '/opt/local/lib/libcrypto.dylib' asFilename exists work?

>
>> I had the same problem when defining environment variable VW_LIBCRYPTO. Of course if the path I give in #libcryptoDylib does not work then the same path should not work with using the environment variable.
>
> Yes, I would expect the same result as above with the env-var set the same way.
>
>> When I loaded the Security-Xtreams package I get the same behavior that I described in the original email.
>
> Hm, it sounds like for some reason the failover isn't kicking in. It's driven by the selection mechanism on the class side of PublicKey/PrivateKey. What does the following return in your image?
>
> PrivateKey selectImplementationFor: #RSA
>
> The selection process is ultimately driven by the pragma adorned methods on concrete subclasses. The bodies of those methods define the conditions under which they apply and the pragma argument defines the selection priority the class is given if the condition is satisfied.
>
>>
>> On Jan 15, 2013, at 8:15 AM, [hidden email] wrote:
>>
>>> Yes this seems to be the case that VW is picking up the older version that doesn't provide the public key algorithm APIs that we need. There are two options available here, you can either help VW find the 1.0.0 library, either by modifying the definition in Xtreams.LibCryptoEVP class>>#libcryptoDylib or by defining environment variable VW_LIBCRYPTO.
>>>
>>> Another option is to try loading package Security-Xtreams which should allow transparent failover to the smalltalk implementations of the public key ciphers. In 7.9 it works only for the public key algorithms, 7.10 can do that for all types of cryptographic algorithms.
>>>
>>> HTH,
>>>
>>> Martin
>>>
>>> "Roger Whitney"<[hidden email]> wrote:
>>>> I am trying to send email through Googles servers using vwnc 7.9. I had this working in vwnc 7.6. Below is the code I am using in 7.9 (with username and password modified). In the 'smtpClient connect' method I first get a dialog that states 'CA Not in Trust Registry' which gives me the option of 'Yes'  or 'No'. Either option gives an exception 'External object not found'. I have attached a trace of the exception. Anyone know how to solve this?
>>>>
>>>> Not sure if it is related my machine has  '0.9.8r release' version of libcrypto.dylib. Actually I also have version 1.0.x of the libcrypto.dylib but it is in /opt/local/lib/ and I don't know how to get the Xtreams-Crypto package to use libcrypto in that location.
>>>>
>>>>
>>>> smtpClient := SMTPClient host: 'smtp.gmail.com' port: 465.
>>>> smtpClient user: (NetUser username: 'myGmailaddress'
>>>> password: 'mypassword').
>>>> smtpClient useAuthentication: true.
>>>> smtpClient useSecureConnection.
>>>>
>>>> message := MailMessage newTextPlain.
>>>> message charset: MimeTypeDescriptor iso8859x1.
>>>> message from: 'myGmailaddress'.
>>>> message date: Timestamp now.
>>>> message
>>>> to: '[hidden email]';
>>>> subject: 'portal test';
>>>> text: 'test'.
>>>> [smtpClient connect]
>>>> on: Xtreams.TLSBadCertificate
>>>> do:
>>>> [:ex |
>>>> Transcript show: ex printString.
>>>> ex proceed].
>>>> [smtpClient send: message.
>>>> Transcript show: 'Mail Sent']
>>>> on: Error
>>>> do:
>>>> [:exception |
>>>> Transcript
>>>> show: 'Error in sending email to: ';
>>>> cr;
>>>> show: exception printString;
>>>> cr;
>>>> show: exception messageText;
>>>> cr]
>>>>
>>>>
>>>>
>>>> ----
>>>> Roger Whitney              Department of Computer Science
>>>> [hidden email]        San Diego State University
>>>> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> vwnc mailing list
>>>> [hidden email]
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>>>
>>>
>>
>>
>> ----
>> Roger Whitney              Department of Computer Science
>> [hidden email]        San Diego State University
>> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
>>
>>
>>
>


----
Roger Whitney              Department of Computer Science
[hidden email]        San Diego State University
http://www.eli.sdsu.edu/   San Diego, CA 92182-7720




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Trouble sending secure email using vwnc 7.9

mkobetic
In reply to this post by Roger Whitney-2
"Roger Whitney"<[hidden email]> wrote:
> The answers to the questions you asked are:
>
> "'/opt/local/lib/libcrypto.dylib' asFilename exists" returns true so VW sees the file. libcrypto.dylib is a link to the actual file. I tried to give the full path to the actual file but Xtreams.LibCryptoEVP class>>versionString claims it could not file that version either.

I'm not sure what's wrong. I note that even while #exists answers true, the file itself may still not be readable for some reason. That may be one more thing to check. Failing that I'm running out of ideas. It is possible and not that difficult to step through the library lookup process, if you feel like it, that may provide more clues.

> "PrivateKey selectImplementationFor: #RSA" returns the Xtreams.SecurityPrivateKey class

That is odd, I'm not sure why it wouldn't kick in if it's the preferred implementation in your environment. I re-checked in a 7.9 image, bumped the priority of SecurityPublicKey up and the TLS handshake automatically picks it up. Is the stack really the same with Security-Xtreams loaded? Can you look around and see how it ends up with LibCryptoPublicKey instead?

It's preferable to get the newer version of libcrypto going, but failing that the fallback should work too. I'm certainly interested to understand what's going on in your case, but I'm running out of guesses at this point.

Martin

>
> On Jan 17, 2013, at 2:11 PM, [hidden email] wrote:
>
> > "Roger Whitney"<[hidden email]> wrote:
> >> thanks for the response, however none of the suggestions worked.
> >>
> >> When I modified Xtreams.LibCryptoEVP class>>#libcryptoDylib and then tried Xtreams.LibCryptoEVP class>>versionString I got an error saying it could not find the library. I tried the absolute path /opt/local/lib/libcrypto.dylib and relative path from the directory that contains the default library. How does one specify the location?
> >
> > Yes, a full path should do it. Could it be that the file isn't readable or some such? Does something like '/opt/local/lib/libcrypto.dylib' asFilename exists work?
>
> >
> >> I had the same problem when defining environment variable VW_LIBCRYPTO. Of course if the path I give in #libcryptoDylib does not work then the same path should not work with using the environment variable.
> >
> > Yes, I would expect the same result as above with the env-var set the same way.
> >
> >> When I loaded the Security-Xtreams package I get the same behavior that I described in the original email.
> >
> > Hm, it sounds like for some reason the failover isn't kicking in. It's driven by the selection mechanism on the class side of PublicKey/PrivateKey. What does the following return in your image?
> >
> > PrivateKey selectImplementationFor: #RSA
> >
> > The selection process is ultimately driven by the pragma adorned methods on concrete subclasses. The bodies of those methods define the conditions under which they apply and the pragma argument defines the selection priority the class is given if the condition is satisfied.
> >
> >>
> >> On Jan 15, 2013, at 8:15 AM, [hidden email] wrote:
> >>
> >>> Yes this seems to be the case that VW is picking up the older version that doesn't provide the public key algorithm APIs that we need. There are two options available here, you can either help VW find the 1.0.0 library, either by modifying the definition in Xtreams.LibCryptoEVP class>>#libcryptoDylib or by defining environment variable VW_LIBCRYPTO.
> >>>
> >>> Another option is to try loading package Security-Xtreams which should allow transparent failover to the smalltalk implementations of the public key ciphers. In 7.9 it works only for the public key algorithms, 7.10 can do that for all types of cryptographic algorithms.
> >>>
> >>> HTH,
> >>>
> >>> Martin
> >>>
> >>> "Roger Whitney"<[hidden email]> wrote:
> >>>> I am trying to send email through Googles servers using vwnc 7.9. I had this working in vwnc 7.6. Below is the code I am using in 7.9 (with username and password modified). In the 'smtpClient connect' method I first get a dialog that states 'CA Not in Trust Registry' which gives me the option of 'Yes'  or 'No'. Either option gives an exception 'External object not found'. I have attached a trace of the exception. Anyone know how to solve this?
> >>>>
> >>>> Not sure if it is related my machine has  '0.9.8r release' version of libcrypto.dylib. Actually I also have version 1.0.x of the libcrypto.dylib but it is in /opt/local/lib/ and I don't know how to get the Xtreams-Crypto package to use libcrypto in that location.
> >>>>
> >>>>
> >>>> smtpClient := SMTPClient host: 'smtp.gmail.com' port: 465.
> >>>> smtpClient user: (NetUser username: 'myGmailaddress'
> >>>> password: 'mypassword').
> >>>> smtpClient useAuthentication: true.
> >>>> smtpClient useSecureConnection.
> >>>>
> >>>> message := MailMessage newTextPlain.
> >>>> message charset: MimeTypeDescriptor iso8859x1.
> >>>> message from: 'myGmailaddress'.
> >>>> message date: Timestamp now.
> >>>> message
> >>>> to: '[hidden email]';
> >>>> subject: 'portal test';
> >>>> text: 'test'.
> >>>> [smtpClient connect]
> >>>> on: Xtreams.TLSBadCertificate
> >>>> do:
> >>>> [:ex |
> >>>> Transcript show: ex printString.
> >>>> ex proceed].
> >>>> [smtpClient send: message.
> >>>> Transcript show: 'Mail Sent']
> >>>> on: Error
> >>>> do:
> >>>> [:exception |
> >>>> Transcript
> >>>> show: 'Error in sending email to: ';
> >>>> cr;
> >>>> show: exception printString;
> >>>> cr;
> >>>> show: exception messageText;
> >>>> cr]
> >>>>
> >>>>
> >>>>
> >>>> ----
> >>>> Roger Whitney              Department of Computer Science
> >>>> [hidden email]        San Diego State University
> >>>> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> vwnc mailing list
> >>>> [hidden email]
> >>>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
> >>>>
> >>>
> >>
> >>
> >> ----
> >> Roger Whitney              Department of Computer Science
> >> [hidden email]        San Diego State University
> >> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
> >>
> >>
> >>
> >
>
>
> ----
> Roger Whitney              Department of Computer Science
> [hidden email]        San Diego State University
> http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
>
>
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc