SSL Handshake

2004-06-18 Thread Madhuri Rambhatla
Hi, 

I am trying to establish a successful handshake with a SSL server. I am
using openSSL version 0.9.7d and my compiler MS Visual Studio.NET and OS
is WIN 2K, Server
I do not see any methods that let me do it. Can someone please tell me
how to establish a successful SSL handshake. 
Thanks.

Madhuri Rambhatla
Lead Systems Programmer
Venue 1 Inc
954 797 9883




__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


SSL Handshake

2001-10-31 Thread java developer

I am having problems with an SSL handshake between per5 on solaris8 and
weblogic5.1 on solaris 7.

i ran ssldump and this is what i got...

> 1 1  0.0500 (0.0500)  C>S  Handshake
>   ClientHello
>Version 3.0
>cipher suites
>SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
>SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
>SSL_RSA_WITH_3DES_EDE_CBC_SHA
>SSL_RSA_WITH_IDEA_CBC_SHA
>SSL_RSA_WITH_RC4_128_SHA
>SSL_RSA_WITH_RC4_128_MD5
>SSL_DHE_RSA_WITH_DES_CBC_SHA
>SSL_DHE_DSS_WITH_DES_CBC_SHA
>SSL_RSA_WITH_DES_CBC_SHA
>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA
>SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
>SSL_RSA_EXPORT_WITH_RC4_40_MD5
>compression methods
>  NULL
> 1 2  0.0507 (0.0007)  S>C  Handshake
>  ServerHello
>Version 3.0
>session_id[32]=
>  3b df 2e 74 9e 6d 59 92 67 c1 4f a1 49 86 4c 6c
>  d5 28 13 85 ca 77 67 11 45 ee c5 7f 53 95 12 5b
>cipherSuite SSL_RSA_WITH_DES_CBC_SHA
>compressionMethod   NULL
> 1 3  0.0979 (0.0471)  S>C  Handshake
>  Certificate
> 1 4  0.0979 (0.)  S>C  Handshake
>  ServerHelloDone
> 1 5  0.1480 (0.0500)  C>S  Handshake
>  ClientKeyExchange
> 1 6  0.1480 (0.)  C>S  ChangeCipherSpec
> 1 7  0.1480 (0.)  C>S  Handshake
> 1 8  0.1724 (0.0244)  S>C  Alert
> level   fatal
>value   bad_record_mac
> 10.1725 (0.)  S>C  TCP FIN


i am hoping someone can shed some light on the output of the ssldump and
what some common causes of the bad_record_mac error are.

thanks.



__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



SSL handshake problem.

2007-10-09 Thread Alessandro Baggi
I'm trying to make a client/server application with ssl connection but 
the handshake doesn't work.


Reading the manual page I've tried to do this to make ssl connection:

Server layer:

SSL_CTX *ssl = NULL;
SSL *new = NULL;
socketdescriptor = socketcreation();
bind(...);
listen(...);
accept(...);
ssl = SSL_CTX_new(SSLv3_server_method());
new = SSL_new(ssl);
SSL_set_fd(ssl, socketdescriptor);
SSL_accept(new);

Client layer:

SSL_CTX *ssl = NULL;
SSL *new = NULL;
socketdescriptor = socketcreation(...);
connect(..);
ssl = SSL_CTX_new(SSLv3_client_method());
new = SSL_new(ssl);
SSL_set_fd(ssl, socketdescriptor);
SSL_connect(new);

When I try to get SSL connection Server give me an error on SSL_accept, 
that return -1 with message: Operation not permitted and Client give me 
on SSL_connect 0 with the same message.

What is the right way to make an ssl connection?

Thanks in advice.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


SSL handshake pb

2007-11-20 Thread jfhuynh

Hello,

I try to connect a client to an SSL server in SSL 3.0 mode.
I do not achieve to have the SSL connexion.
When I look at the IP streams, I can see the Hello client message and the
handshake phase during which I see the certificate sent by the server to the
client ( during this phase, I can see that the message content type is 22 which
is normal).

After that, I can see the change cipher message sent by the server (whose
content type is 20 (14 in hexadecimal representation -b see below the stream..)
extract :
 1403 01011603 4058 b733e063 |[EMAIL PROTECTED]|
0010 af7fad75 c0880025 684d3a3a 2caeb950 |...u...%hM::,..P|
0020 b093b5c6 1b571fa3 a683be1b 2992e60c |.W..)...|
0030 869cb580 38fbb8c2 e21006de f78f6bf9 |8.k.|
0040 9cab96d8 b5a9d57f 6d4412|mD. |

But then, the client , instead of sending me an applicative message ( content
type  23 (17  in hexadecimal representation), sends me a message whose content
type is 21( 15 in hex) see below the corresponding IP stream.
 1503 18e35af3 0b16fb3f 1855e19c |..Z?.U..|
0010 e2fae11f 40418fa5 f7d422e8 58   |[EMAIL PROTECTED]".X   |

Can anyone tells me what this message means ? ( I have not seen it in my SSL
documents).

Thank you in advance,



__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


ssl handshake shortcut

2004-06-16 Thread Dirk Hain
Hello everybody,
I am very interested if despite its specification the ssl handshake can be 
reduced to one message send from the client to the server and one from the 
server to the client (saying just one message loop).

I am thinking of skipping the protocol/cypto negotiation phase by setting 
everything on client and server explicitly. I know that the session id is 
established during that phase as well but maybe there is a way to reduce the 
number of loops from 2 to 1.

Every hint is very appreciated!
Thanks
- Dirk
_
Looking to buy a house? Get informed with the Home Buying Guide from MSN 
House & Home. http://coldwellbanker.msn.com/

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


RE: SSL Handshake

2004-06-18 Thread Saju Paul
Check 'Network Security with OpenSSL' by John Veiga, Matt Messier and Pravir
Chandra

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Madhuri Rambhatla
Sent: Friday, June 18, 2004 10:14 AM
To: [EMAIL PROTECTED]
Subject: SSL Handshake


Hi,

I am trying to establish a successful handshake with a SSL server. I am
using openSSL version 0.9.7d and my compiler MS Visual Studio.NET and OS
is WIN 2K, Server
I do not see any methods that let me do it. Can someone please tell me
how to establish a successful SSL handshake.
Thanks.

Madhuri Rambhatla
Lead Systems Programmer
Venue 1 Inc
954 797 9883




__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


SSL handshake failed

2005-04-17 Thread Asif Iqbal
Hi All

I installed Apache/1.3.33 (Unix) mod_perl/1.29 mod_ssl/2.8.22
OpenSSL/0.9.7d on Solaris

But when I try to browse it using https://my.website.com I am getting
the following error in the browser:

The connection to my.website.com has terminated unexpectedly. Some data
may have been transferred

The Apache error log says:

[Sun Apr 17 22:35:21 2005] [error] mod_ssl: SSL handshake failed (server
my.website.com:443, client 192.168.0.15) (OpenSSL library error follows)
[Sun Apr 17 22:35:21 2005] [error] OpenSSL: error:1409D08A:SSL 
routines:SSL3_SETUP_KEY_BLOCK:cipher 
or hash unavailable

This is how my SSLCipherSuite looks like in httpd.conf:

SSLCipherSuite 
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

I tried to change it like these and neither one was successful:

SSLCipherSuite 
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+SSLv3:+EXP:+eNULL
-OR-
SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW

I used Google to search the OpenSSL and modssl sites and the web with so
solution. Any help or suggestion would be greatly appreciated.

Thanks
-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"..there are two kinds of people: those who work and those who take the 
credit...try
 to be in the first group;...less competition there."  - Indira Gandhi
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


SSL handshake Failure

1999-04-20 Thread azhar

  I am having these problem about the SSL handshake, the stronghold server
return the error code 0x28 (hanshake-failure) after my SSL client program send
the Client_key_exchange (0x16,0x03,0x00,..), Cipher_change_spec
(0x14,0x03,0x00,) and client-hanshake_finished(0x16,0x03,0x00,...). The
server immediately send me a alert packet
(0x15,0x03,0x00,0x00,0x02,0x02,0x28). Could some body tell me what
handshake_failure mean, its definition and causes of the error.

Thank you for your help.

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



SSL handshake error

1999-09-23 Thread Goetz Babin-Ebell

Hallo,

In OpenSSL 0.9.3a I get the folowing handshake error:
(WindowsNT)


SSL_connct: 11 to Host before/connect initialization
SSL_connct: 11 to Host SSLv3 write client hello A
SSL_read  : 11 to Host SSL3 alert fatal:handshake failure

165:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake
failure:.\ssl\s3_pkt.c:767:SSL alert number 40

(at least Netscape fails, too)

Does anybody know what fails ?

By

Goetz

-- 
Goetz Babin-Ebell  mailto:[EMAIL PROTECTED]
TC Trust Center for Security   http://www.trustcenter.de
in Data Networks GmbH  Tel.: +49-40-766 29 3301
Am Werder 1 / 21073 Hamburg / Germany  Fax.: +49-40-766 29 577
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



ssl handshake failure

1999-10-07 Thread Peter Ziatek

Hi, 

I'm trying to connect to a site with a self signed certificate. And I
get the below error message. I am able to correctly connect to other
secured sites...

Thanks in advance for the help.

8 /home/pziatek > openssl s_client -connect security.corp.sgi.com:443
-state
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:SSLv3 read server hello A
depth=0 /C=US/ST=CA/L=Mountain
[EMAIL PROTECTED]
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=US/ST=CA/L=Mountain
[EMAIL PROTECTED]
verify return:1
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL3 alert read:fatal:bad record mac
SSL_connect:failed in SSLv3 read finished A
1113:error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad record
mac:s3_pkt.c:774:SSL alert number 20
1113:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake
failure:s23_lib.c:203:
CONNECTED(0003)


--   ..

Peter Ziatek
Silicon Graphics, Inc.
650.933.6955
[EMAIL PROTECTED]
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



SSL handshake failed

2000-03-11 Thread Patrick Barmentlo


Hai,

I've got something that's confusion me :

Browser notice: 
'Netcape has encouterd bad data from the server'

Different versions of netscape communicator 4.61 and 4.7 (FreeBSD)
(non-us) from different pc's: Same error!
>From other pc's, same browsers: No problem.
(al the win32 browsers had no problems at all)


Apache error:
[error] mod_ssl: SSL handshake failed (server myserver.net:443,
client 195.38.232.12) (OpenSSL library error follows)
[error] OpenSSL: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert
handshake failure

This is on Apache 1.3.11 AND 1.3.12
with openssl openssl-0.9.4
mod_ssl-2.6.2-1.3.11 AND 2.5.0-1.3.12
Running on FreeBSD-STABLE



I've made more boxes running this software and there is no problem
connecting to this boxes at all!!
A succesfull connect from the 'problem' clients looks like this in the
apache logging:
 
Connection: Client IP: 195.38.232.12, Protocol: SSLv3, Cipher:
EXP-RC4-MD5 (40/128 bits) 
[info]  Initial (No.1) HTTPS request received for child 4 (server
www.mydomain.net:443)

Any one a hint ?

Thanks

--
Patrick Barmentlo
[EMAIL PROTECTED] - pgp key ID 0x8E372335


__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



ssl handshake state

2001-07-11 Thread Zhong Chen

In the ssl state machine, there are additional state with prefix "_MT_".
Is this for multi-thread? In which case the state machine will go to
these states? Is there a API to control it?
Thanks.

Zhong

#define SSL3_MT_HELLO_REQUEST   0
#define SSL3_MT_CLIENT_HELLO1
#define SSL3_MT_SERVER_HELLO2
#define SSL3_MT_CERTIFICATE 11
#define SSL3_MT_SERVER_KEY_EXCHANGE 12
#define SSL3_MT_CERTIFICATE_REQUEST 13
#define SSL3_MT_SERVER_DONE 14
#define SSL3_MT_CERTIFICATE_VERIFY  15
#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
#define SSL3_MT_FINISHED20
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



SSL handshake failure

2001-10-01 Thread Costas Magos

Hi to all,

I'm running an Apache server (1.3.19) with openssl 0.9.6b on Solaris 2.6 / 
SPARCclassic platform. Apache serves a site that accesses a database 
through various cgi-scripts or through a java applet for more specialized 
actions. The database is managed just fine with the cgi-scripts, but when I 
try to load the java applet to do some advanced configuration, the browser 
hangs at some point (while loading some classes) and the server produces 
the following error logs:

[info] [client xxx.xxx.xxx.xxx] SSL accept timeout timed out
[error] SSL_accept failed

and then

[debug] apache_ssl.c(1123): Generating 512 bit key
[debug] apache_ssl.c(287): SSL_accept returned 0
[debug] apache_ssl.c(291): error:14094410:SSL 
routines:SSL3_READ_BYTES:sslv3 alert handshake failure
[debug] apache_ssl.c(379): Random input /dev/random(1024) -> 1024
[debug] apache_ssl.c(1123): Generating 512 bit key
[debug] apache_ssl.c(287): SSL_accept returned 0
[debug] apache_ssl.c(291): error:14094410:SSL 
routines:SSL3_READ_BYTES:sslv3 alert handshake failure
[debug] apache_ssl.c(379): Random input /dev/random(1024) -> 1024
[debug] apache_ssl.c(1123): Generating 512 bit key
[debug] apache_ssl.c(287): SSL_accept returned 0
[debug] apache_ssl.c(291): error:14094410:SSL 
routines:SSL3_READ_BYTES:sslv3 alert handshake failure
[debug] apache_ssl.c(379): Random input /dev/random(1024) -> 1024
[debug] apache_ssl.c(1123): Generating 512 bit key
[debug] apache_ssl.c(287): SSL_accept returned 0
[debug] apache_ssl.c(291): error:14094410:SSL 
routines:SSL3_READ_BYTES:sslv3 alert handshake failure
...
..
.

These 'handshake failure' logs continue for a while and then the browser 
seems to overcome the trouble. It confinues to load the classes and the 
server gives out a lot of the following logs:

[debug] buff.c(295): read returned 261 rwstate=1 state=3 rstate=240 cren=0 
aren=0 accept=4
[debug] buff.c(295): read returned 270 rwstate=1 state=3 rstate=240 cren=0 
aren=0 accept=4
[debug] buff.c(295): read returned 252 rwstate=1 state=3 rstate=240 cren=0 
aren=0 accept=4

But after that again, it hangs again, as it did in the beggining and a "Web 
Server I/O error" window appears.
The site has been tested with SSL disabled and runs without problems.

Does anynone knows what is going on? Any help would be much appreciated. 
Thanks in advance.

Respectfully,

~~
Costas Magos
Ariadne-t Network Operation Center,
~~
email: [EMAIL PROTECTED], [EMAIL PROTECTED]
tel.: +30 1 6544279,
+30 1 6503125
fax:  +30 1 6532910

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



SSL Handshake problem

2001-10-30 Thread java developer

Is anyone aware of SSL handshake problems with using the latest OpenSSL
package with BEA Weblogic 5.1?
If so, please elaborate... If not, any clues as to what things to look for
in handshake problems would be greatly appreciated.

Thanks.



__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



ssl handshake error

2003-08-12 Thread Tom McSherry

Hi,
I am using openssl-0.9.5. The openSSL API is used within the Kannel open
source C http library.Platform: Windows NT. The following error is  occuring
quite often when https requests are made to my secure server:
2003-08-06 09:58:39 [3] WARNING: SSL: handshake interrupted by system (stop
button pressed in browser?!)
2003-08-06 09:58:39 [3] ERROR: SSL: OpenSSL: error:::lib(0) :func(0)
:reason(0)
2003-08-06 09:58:39 [3] WARNING: SSL: disconnecting.
2003-08-06 09:58:39 [3] ERROR: HTTP: unsuccessfull SSL handshake for client
'X.X.X.X'
It occurs intermittently and some requests are processed successfully but
when it occurs multiple times in succession it causes the server to hang and
no more requests are processed.
Any suggestions?
Thanks
Tom

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


SSL Handshake question

2009-06-02 Thread Steve Gallivan
Hello,

I apologize if this is an obvious NOOB question - my Google-Fu is not up to 
snuff on this one:

We're running  OpenSSL 0.9.8j 07 Jan 2009 and Server version: Apache/2.0.63 on 
a  Sunfire 280R running Solaris 9.

Clients are having intermittent problems successfully completing the SSL 
Handshake.

Running a trace on the wire revealed that the successful handshakes looked like 
this:
Client -> Server: Client Hello
Server -> Client: Server Hello
Server -> Client: Certificate
Client -> Server: Client Key Exchange
And so on, all good.

On the failures the exchange looks like this:
Client -> Server:  Client Hello
Server -> Client: Server Hello, Certificate, Server Hello Done
Client -> Server: Fatal, Description: Certificate Unknown

In running repeated tests using a java test client, we have many successful 
handshakes ( we close the socket after each one ) and then we'll hit a series 
of several failed ones, say 4-10 in a row, then it's all good again.
I'm trying to understand why the server would answer some requests with a 
"Server Hello, Certificate, Server Hello Done" all wrapped up in one packet ( 
the ones that are failing ), where most of the time it splits that out over 
several packets. The test "Client Hello" requests seem identical.

Any insights would be much appreciated.

Thanks,
Steve


SSL handshake failure

2010-11-14 Thread Timur Elzhov
Hi, openssl experts!

It's required to transfer data to Apple Push service that is located at
gateway.sandbox.push.apple.com:2195. I'm given the certificate and private
key both included in Certificate_and_key.pem. Trying to connect:

$ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -CAfile
> EntrustCA.pem -cert Certificate_and_key.pem


Server's certificate is passed successfully (with CA included in
EntrustCA.pem) but the error is following:

140735074831484:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert
> certificate unknown:s3_pkt.c:1193:SSL alert number 46

140735074831484:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake
> failure:s23_lib.c:184:


I tried to google about alert 46, but found only that "something wrong with
client's certificate". Is it possible to get more details about failure?

Below is some info that might probably be helpful. I read about X509v3
extensions just tonight, and it's not clear for me by far if extensions
could relate to my problem:

$ openssl verify -CAfile AppleCA.pem Certificate_and_key.pem

 . . .
error 34 at 0 depth lookup:unhandled critical extension
OK

$ openssl x509 -in Certificate_and_key.pem -text -noout -purpose


here are all extensions marked as "critical":

   X509v3 extensions:

   X509v3 Basic Constraints: critical

   CA:FALSE

   X509v3 Extended Key Usage: critical

   Code Signing

   X509v3 Key Usage: critical

   Digital Signature

. . .

Certificate purposes:

SSL client : No

SSL client CA : No

SSL server : No

SSL server CA : No

Netscape SSL server : No

Netscape SSL server CA : No

S/MIME signing : No

S/MIME signing CA : No

S/MIME encryption : No

S/MIME encryption CA : No

CRL signing : No

CRL signing CA : No

Any Purpose : Yes

Any Purpose CA : Yes

OCSP helper : Yes

OCSP helper CA : No

Time Stamp signing : No

Time Stamp signing CA : No


maybe, the "SSL client : No" line is related to connection failure?

Much thanks in advance!

--
WBR,
Timur


very slow ssl handshake

2007-09-04 Thread mrahin

I have a server built using OpenSSL and a Java client that uses PureTLS. On
occassions I see a very long delay (> 5 mins) between Client Hello (the
server returns an ack to the clientHello almost immediately) and the Server
Hello. What could cause this long delay? I have Ethereal traces if anyone
wishes to see that.

- mrahin
-- 
View this message in context: 
http://www.nabble.com/very-slow-ssl-handshake-tf4353602.html#a12405288
Sent from the OpenSSL - User mailing list archive at Nabble.com.

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


books about ssl handshake?

2007-09-10 Thread Koza

Hi,

Can you recommend any book about secure connections, ssl, handshake and the
things alike? Would be nice if it has some reference to openssl, but it is
not absolutely necessary.

I would be grateful for any suggestions.
Thanks,
Koza
-- 
View this message in context: 
http://www.nabble.com/books-about-ssl-handshake--tf4417791.html#a12600721
Sent from the OpenSSL - User mailing list archive at Nabble.com.

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: SSL handshake problem.

2007-10-09 Thread Frans de Boer
Unless someone recognizes the text, it might be helpful if you tell a
little more about the server and client side.

frans.

On Wed, 2007-10-10 at 00:09 +0200, Alessandro Baggi wrote:
> I'm trying to make a client/server application with ssl connection but 
> the handshake doesn't work.
> 
> Reading the manual page I've tried to do this to make ssl connection:
> 
> Server layer:
> 
> SSL_CTX *ssl = NULL;
> SSL *new = NULL;
> socketdescriptor = socketcreation();
> bind(...);
> listen(...);
> accept(...);
> ssl = SSL_CTX_new(SSLv3_server_method());
> new = SSL_new(ssl);
> SSL_set_fd(ssl, socketdescriptor);
> SSL_accept(new);
> 
> Client layer:
> 
> SSL_CTX *ssl = NULL;
> SSL *new = NULL;
> socketdescriptor = socketcreation(...);
> connect(..);
> ssl = SSL_CTX_new(SSLv3_client_method());
> new = SSL_new(ssl);
> SSL_set_fd(ssl, socketdescriptor);
> SSL_connect(new);
> 
> When I try to get SSL connection Server give me an error on SSL_accept, 
> that return -1 with message: Operation not permitted and Client give me 
> on SSL_connect 0 with the same message.
> What is the right way to make an ssl connection?
> 
> Thanks in advice.
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing Listopenssl-users@openssl.org
> Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: SSL handshake problem.

2007-10-09 Thread Alex Lam
Hi Alessandro,

You will need to set up a handful of cipher & certificate related settings
before server and client will join.
I suggest you take a look at the apps/s_server.c and apps/s_client.c

regards,
alex

On 10/9/07, Alessandro Baggi <[EMAIL PROTECTED]> wrote:
>
> I'm trying to make a client/server application with ssl connection but
> the handshake doesn't work.
>
> Reading the manual page I've tried to do this to make ssl connection:
>
> Server layer:
>
> SSL_CTX *ssl = NULL;
> SSL *new = NULL;
> socketdescriptor = socketcreation();
> bind(...);
> listen(...);
> accept(...);
> ssl = SSL_CTX_new(SSLv3_server_method());
> new = SSL_new(ssl);
> SSL_set_fd(ssl, socketdescriptor);
> SSL_accept(new);
>
> Client layer:
>
> SSL_CTX *ssl = NULL;
> SSL *new = NULL;
> socketdescriptor = socketcreation(...);
> connect(..);
> ssl = SSL_CTX_new(SSLv3_client_method());
> new = SSL_new(ssl);
> SSL_set_fd(ssl, socketdescriptor);
> SSL_connect(new);
>
> When I try to get SSL connection Server give me an error on SSL_accept,
> that return -1 with message: Operation not permitted and Client give me
> on SSL_connect 0 with the same message.
> What is the right way to make an ssl connection?
>
> Thanks in advice.
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing Listopenssl-users@openssl.org
> Automated List Manager   [EMAIL PROTECTED]
>


Re: SSL handshake problem.

2007-10-09 Thread Sukanta Panigrahi

I have a basic question here:
Is it mandatory to have the server configured with ciphers/certificates 
for SSL handshake?


Thanks / Sukant

Alex Lam wrote:

Hi Alessandro,

You will need to set up a handful of cipher & certificate related 
settings before server and client will join.

I suggest you take a look at the apps/s_server.c and apps/s_client.c

regards,
alex

On 10/9/07, *Alessandro Baggi* <[EMAIL PROTECTED] 
<mailto:[EMAIL PROTECTED]>> wrote:


I'm trying to make a client/server application with ssl connection but
the handshake doesn't work.

Reading the manual page I've tried to do this to make ssl connection:

Server layer:

SSL_CTX *ssl = NULL;
SSL *new = NULL;
socketdescriptor = socketcreation();
bind(...);
listen(...);
accept(...);
ssl = SSL_CTX_new(SSLv3_server_method());
new = SSL_new(ssl);
SSL_set_fd(ssl, socketdescriptor);
SSL_accept(new);

Client layer:

SSL_CTX *ssl = NULL;
SSL *new = NULL;
socketdescriptor = socketcreation(...);
connect(..);
ssl = SSL_CTX_new(SSLv3_client_method());
new = SSL_new(ssl);
SSL_set_fd(ssl, socketdescriptor);
SSL_connect(new);

When I try to get SSL connection Server give me an error on
SSL_accept,
that return -1 with message: Operation not permitted and Client
give me
on SSL_connect 0 with the same message.
What is the right way to make an ssl connection?

Thanks in advice.
__
OpenSSL Project http://www.openssl.org
User Support Mailing
Listopenssl-users@openssl.org
<mailto:openssl-users@openssl.org>
Automated List Manager  
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>





__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: SSL handshake problem.

2007-10-10 Thread jimmy bahuleyan
Sukanta Panigrahi wrote:
> I have a basic question here:
> Is it mandatory to have the server configured with ciphers/certificates
> for SSL handshake?
> 
> Thanks / Sukant

well, ciphers - yes. If you don't do it, openssl gives you a default
cipher list.

certificates - not all the time. If you're using a ADH cipher,
certificates are not needed, but then most of the time you need identity
verification which means you need to use certs.

-jb
-- 
No snowflake in an avalanche ever feels responsible.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: SSL handshake pb

2007-11-20 Thread Marek Marcola
Hello,
> I try to connect a client to an SSL server in SSL 3.0 mode.
> I do not achieve to have the SSL connexion.
> When I look at the IP streams, I can see the Hello client message and the
> handshake phase during which I see the certificate sent by the server to the
> client ( during this phase, I can see that the message content type is 22 
> which
> is normal).
> 
> After that, I can see the change cipher message sent by the server (whose
> content type is 20 (14 in hexadecimal representation -b see below the 
> stream..)
> extract :
>  1403 01011603 4058 b733e063 |[EMAIL PROTECTED]|
> 0010 af7fad75 c0880025 684d3a3a 2caeb950 |...u...%hM::,..P|
> 0020 b093b5c6 1b571fa3 a683be1b 2992e60c |.W..)...|
> 0030 869cb580 38fbb8c2 e21006de f78f6bf9 |8.k.|
> 0040 9cab96d8 b5a9d57f 6d4412|mD. |
> 
> But then, the client , instead of sending me an applicative message ( content
> type  23 (17  in hexadecimal representation), sends me a message whose content
> type is 21( 15 in hex) see below the corresponding IP stream.
>  1503 18e35af3 0b16fb3f 1855e19c |..Z?.U..|
> 0010 e2fae11f 40418fa5 f7d422e8 58   |[EMAIL PROTECTED]".X   |
> 
> Can anyone tells me what this message means ? ( I have not seen it in my SSL
> documents).
This is alert message. This message informs server of some error/warning
send from client to server. After exchange of ChangeCipherSpec alert
message are encrypted (as in your example) and based on this dump is
hard to say why client sends this Alert. When alert message is
unencrypted it has length of 7 bytes (5- header, 2-alert data).

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: SSL handshake pb

2007-11-21 Thread jfhuynh
Selon Marek Marcola <[EMAIL PROTECTED]>:

Thank you very much for the response ..

> Hello,
> > I try to connect a client to an SSL server in SSL 3.0 mode.
> > I do not achieve to have the SSL connexion.
> > When I look at the IP streams, I can see the Hello client message and the
> > handshake phase during which I see the certificate sent by the server to
> the
> > client ( during this phase, I can see that the message content type is 22
> which
> > is normal).
> >
> > After that, I can see the change cipher message sent by the server (whose
> > content type is 20 (14 in hexadecimal representation -b see below the
> stream..)
> > extract :
> >  1403 01011603 4058 b733e063 |[EMAIL PROTECTED]|
> > 0010 af7fad75 c0880025 684d3a3a 2caeb950 |...u...%hM::,..P|
> > 0020 b093b5c6 1b571fa3 a683be1b 2992e60c |.W..)...|
> > 0030 869cb580 38fbb8c2 e21006de f78f6bf9 |8.k.|
> > 0040 9cab96d8 b5a9d57f 6d4412|mD. |
> >
> > But then, the client , instead of sending me an applicative message (
> content
> > type  23 (17  in hexadecimal representation), sends me a message whose
> content
> > type is 21( 15 in hex) see below the corresponding IP stream.
> >  1503 18e35af3 0b16fb3f 1855e19c |..Z?.U..|
> > 0010 e2fae11f 40418fa5 f7d422e8 58   |[EMAIL PROTECTED]".X  
> >  |
> >
> > Can anyone tells me what this message means ? ( I have not seen it in my
> SSL
> > documents).
> This is alert message. This message informs server of some error/warning
> send from client to server. After exchange of ChangeCipherSpec alert
> message are encrypted (as in your example) and based on this dump is
> hard to say why client sends this Alert. When alert message is
> unencrypted it has length of 7 bytes (5- header, 2-alert data).
>
> Best regards,
> --
> Marek Marcola <[EMAIL PROTECTED]>
>
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing Listopenssl-users@openssl.org
> Automated List Manager   [EMAIL PROTECTED]
>


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


SSL Handshake custom implementation

2004-09-03 Thread Amit Sharma
Greetings,

I am interested in a rough & quick experiment with the SSL handshake
process. My idea is to custom create the handshake layer in SSL with my
own version of SSL handshake, keeping everything else intact in the SSL
protocol. I am wondering if I can use some library/command line (such
as, openssl) that shall allow me to tweak around the SSL handshake
instead of rewriting the complete protocol. Any documentation on the
implementation of the SSL handshake will also be quite useful.

Any ideas?

Thanx in advance,
Gracias,
Amit

PS. I am relatively new to openssl. Incase therez some pre-requisite to
do so using openssl, please advice.


__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Questions about ssl handshake

2005-04-06 Thread Gallie mailing-list
Hello. I've sent my question to the wrong group previously.

I'm a beginner of using the ssl library. I got a problem about handshaking.

I need to do an application to read all the incoming and outgoing
traffic, including the handshaking of ssl.
I would like to know where and which functions are being used during
the handshake.

Can anyone help me?

Thank you in advance.

Gallie
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: SSL handshake failed

2005-04-18 Thread Asif Iqbal
On Sun, Apr 17, 2005 at 10:53:50PM, Asif Iqbal wrote:
> Hi All
> 
> I installed Apache/1.3.33 (Unix) mod_perl/1.29 mod_ssl/2.8.22
> OpenSSL/0.9.7d on Solaris

Upgrade OpenSSL to latest to fix the problem. Thanks

-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"..there are two kinds of people: those who work and those who take the 
credit...try
 to be in the first group;...less competition there."  - Indira Gandhi
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Detect SSL handshake completion

2005-08-05 Thread Eduri, Eswar M
Title: Detect SSL handshake completion






Hello,

Is it possible for an ‘engine’ to detect when an SSL handshake has started or completed? Appreciate your help.

regards,

Eswar Eduri






Re: SSL handshake error

1999-09-23 Thread Bodo Moeller

On Thu, Sep 23, 1999 at 03:17:32PM +0200, Goetz Babin-Ebell wrote:

> In OpenSSL 0.9.3a I get the folowing handshake error:
> (WindowsNT)
> 
> 
> SSL_connct: 11 to Host before/connect initialization
> SSL_connct: 11 to Host SSLv3 write client hello A
> SSL_read  : 11 to Host SSL3 alert fatal:handshake failure
> 
> 165:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake
> failure:.\ssl\s3_pkt.c:767:SSL alert number 40
> 
> (at least Netscape fails, too)
> 
> Does anybody know what fails ?

Both server and client are OpenSSL 0.9.3a?  It's hard to tell what is
going wrong if you don't provide the *server*-side error message ...
anyway, I've recently fixed various bugs in the client hello
processing, so you should try again with a server that uses the
current (0.9.5-dev) OpenSSL snapshot; this might help, and at least
chances are that the server will generate more useful error messages
than with versions up to 0.9.4.
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Spurious SSL handshake interrupt

2000-03-16 Thread Jim Rice

Greetings!

Forgive the question, but what are these?

[16/Mar/2000 10:43:59 00208] [info]  Spurious SSL handshake
interrupt[Hint: Usua
lly just one of those OpenSSL confusions!?]
[16/Mar/2000 10:44:19 00403] [info]  Connection to child 5 established
(server d
b2.rack01.techfuel.com:443, client 172.31.254.10)
[16/Mar/2000 10:44:19 00403] [info]  Spurious SSL handshake
interrupt[Hint: Usua
lly just one of those OpenSSL confusions!?]
[16/Mar/2000 10:44:28 00586] [info]  Connection to child 7 established
(server d
b2.rack01.techfuel.com:443, client 172.31.254.11)
[16/Mar/2000 10:44:28 00586] [info]  Spurious SSL handshake
interrupt[Hint: Usua
lly just one of those OpenSSL confusions!?]
[16/Mar/2000 10:44:18 01759] [info]  Spurious SSL handshake
interrupt[Hint: Usua
lly just one of those OpenSSL confusions!?]
[16/Mar/2000 10:43:28 00256] [info]  Spurious SSL handshake
interrupt[Hint: Usua
lly just one of those OpenSSL confusions!?] 

The ssl_engine_log is over 500 Mbytes and growing.  H...  Is there a
FAQ?

Also, we will be setting up virtual servers.
Where do I specify the path in the configs for the ssl_mutex lock files?
I'm getting some errors:

[Fri Mar 10 15:20:27 2000] [error] mod_ssl: Child could not open
SSLMutex lockfi
le /usr/local/apache/logs/ssl_mutex.180 (System error follows)
[Fri Mar 10 15:20:27 2000] [error] System: No such file or directory
(errno: 2)
[Fri Mar 10 15:20:27 2000] [error] mod_ssl: Child could not open
SSLMutex lockfi
le /usr/local/apache/logs/ssl_mutex.180 (System error follows)
[Fri Mar 10 15:20:27 2000] [error] System: No such file or directory
(errno: 2)
[Fri Mar 10 15:20:28 2000] [error] mod_ssl: Child could not open
SSLMutex lockfi
le /usr/local/apache/logs/ssl_mutex.180 (System error follows)
[Fri Mar 10 15:20:28 2000] [error] System: No such file or directory
(errno: 2)

I think I need a separate log directory for each server.



Thanx!
-- 
Jim Rice   o~ o~ dir:(949) 609-0412
Techfuel, Inc.   +-/-'  @ ==@ net:  [EMAIL PROTECTED]
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



URGENT : SSL Handshake failed

2001-01-25 Thread drt rappanah




Hi !!
 
    I've installed a Netscape 
Certificate Server 4.2sp1 on a linux mandrake 7.2 (kernel 
2.2.17-21)...
    I've also installed an Apache 
1.3.14 server with mod_perl 1.24_01, mod_ssl 2.2.7, php 4.0.3pl1 and openssl 
0.9.6...
    I've signed Apache certificate 
with the Certificate server.
    I use a Netscape browser 
(communicator 4.75) or Internet Explorer (5.00.3103.1000 128 bits) to have a 
certificate from the Certificate Server.
I can't access to the 
Apache web server because of this following error :
 
[Tue Jan 23 13:21:14 2001] [error] mod_ssl: 
Certificate Verification: Error (20): unable to get local issuer 
certificate[Tue Jan 23 13:21:14 2001] [error] mod_ssl: SSL handshake failed 
(server cerbereweb.anpe.fr:843, client 10.0.144.161) (OpenSSL library error 
follows)[Tue Jan 23 13:21:14 2001] [error] OpenSSL: error:140890B2:SSL 
routines:SSL3_GET_CLIENT_CERTIFICATE:no certificate returned
 
In my httpd.conf, I have the line    
SSLVerifyClient    require
  SSLVerifyDepth    
10
 
Thanks for your help.
Thanks in advance.
Regards,
Ravi APPANAH


  
  

  
  
APPANAH 
  Ravi
CF6 Groupe 
  TELINDUS
  

  Consultant Sécurité Tél.  : +33 1 41 91 39 00 
  Fax  : +33 1 41 91 39 99 Gsm : +33 6 20 78 29 63 
  [EMAIL PROTECTED]
Parc de la Défense 41 rue 
  des Trois Fontanot 92024 Nanterre http://www.cf6.fr
 
 


URGENT : SSL Handshake failed

2001-01-26 Thread drt rappanah



 
Hi !!
 
    I've installed a Netscape 
Certificate Server 4.2sp1 on a linux mandrake 7.2 (kernel 
2.2.17-21)...
    I've also installed an Apache 
1.3.14 server with mod_perl 1.24_01, mod_ssl 2.7.1, php 4.0.3pl1 and openssl 
0.9.6...
    I've signed Apache certificate 
with the Certificate server.
    I use a Netscape browser 
(communicator 4.75) or Internet Explorer (5.00.3103.1000 128 bits) to have a 
certificate from the Certificate Server.
I can't access to the 
Apache web server because of this following error :
 
[23/jan/2001 17:22:50 14800] [info]  
Connection to child 0 established (server cerbereweb.anpe.fr:843, client 
10.0.144.161)[23/jan/2001 17:22:50 14800] [info]  Seeding PRNG with 
1160 bytes of entropy[23/jan/2001 17:22:50 14800] [trace] OpenSSL: 
Handshake: start[23/jan/2001 17:22:50 14800] [trace] OpenSSL: Loop: 
before/accept initialization[23/jan/2001 17:22:50 14800] [trace] OpenSSL: 
Loop: SSLv3 read client hello A[23/jan/2001 17:22:50 14800] [trace] OpenSSL: 
Loop: SSLv3 write server hello A[23/jan/2001 17:22:50 14800] [trace] 
OpenSSL: Loop: SSLv3 write certificate A[23/jan/2001 17:22:50 14800] [trace] 
OpenSSL: Loop: SSLv3 write certificate request A[23/jan/2001 17:22:50 14800] 
[trace] OpenSSL: Loop: SSLv3 flush data[23/jan/2001 17:22:52 14800] [trace] 
Certificate Verification: depth: 0, subject: 
/C=FR/O=ANPE/OU=DRT/0.9.2342.19200300.100.1.1=hcover/CN=HARRY 
[EMAIL PROTECTED], issuer: 
/C=FR/L=NOISIEL/O=ANPE/OU=DRT/CN=Cerbere Certificate Manager[23/jan/2001 
17:22:52 14800] [error] Certificate Verification: Error (20): unable to get 
local issuer certificate[23/jan/2001 17:22:52 14800] [trace] OpenSSL: Write: 
SSLv3 read client certificate B[23/jan/2001 17:22:52 14800] [trace] OpenSSL: 
Exit: error in SSLv3 read client certificate B[23/jan/2001 17:22:52 14800] 
[trace] OpenSSL: Exit: error in SSLv3 read client certificate B[23/jan/2001 
17:22:52 14800] [error] SSL handshake failed (server cerbereweb.anpe.fr:843, 
client 10.0.144.161) (OpenSSL library error follows)[23/jan/2001 17:22:52 
14800] [error] OpenSSL: error:140890B2:SSL 
routines:SSL3_GET_CLIENT_CERTIFICATE:no certificate returned
 
In my httpd.conf, I have the line    
SSLVerifyClient    require
  SSLVerifyDepth    
10
 
Thanks for your help.
Thanks in advance.
Regards,
Ravi APPANAH



Re: tracing SSL handshake?

2001-04-24 Thread Greg Stark

Also you might find the ssldump tool useful. Please see
www.rtfm.com/ssldump.

_
Greg Stark
Ethentica, Inc.
[EMAIL PROTECTED]
_



- Original Message -
From: "Lutz Jaenicke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 7:07 PM
Subject: Re: tracing SSL handshake?


> On Mon, Apr 23, 2001 at 04:45:13PM -0400, George Lind wrote:
> > >  -Original Message-
> > > From: George Lind
> > > Sent: Monday, April 23, 2001 2:23 PM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: tracing SSL handshake?
> > >
> > > I would like my server program to be able to trace all the data that
is
> > > being passed back and forth during the handshake.  How do I do this?
>
> grep for "bio_dump_cb" in openssl/apps/*.c
>
> Best regards,
> Lutz
> --
> Lutz Jaenicke [EMAIL PROTECTED]
> BTU Cottbus   http://www.aet.TU-Cottbus.DE/personen/jaenicke/
> Lehrstuhl Allgemeine Elektrotechnik  Tel. +49 355 69-4129
> Universitaetsplatz 3-4, D-03044 Cottbus  Fax. +49 355 69-4153
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing List[EMAIL PROTECTED]
> Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



RE: ssl handshake state

2001-07-13 Thread Zhong Chen

Anybody can explain me these SSL3_MT_* state? 
Thanks.

-Zhong

-Original Message-
From: Zhong Chen 
Sent: Wednesday, July 11, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: ssl handshake state


In the ssl state machine, there are additional state with prefix "_MT_".
Is this for multi-thread? In which case the state machine will go to
these states? Is there a API to control it?
Thanks.

Zhong

#define SSL3_MT_HELLO_REQUEST   0
#define SSL3_MT_CLIENT_HELLO1
#define SSL3_MT_SERVER_HELLO2
#define SSL3_MT_CERTIFICATE 11
#define SSL3_MT_SERVER_KEY_EXCHANGE 12
#define SSL3_MT_CERTIFICATE_REQUEST 13
#define SSL3_MT_SERVER_DONE 14
#define SSL3_MT_CERTIFICATE_VERIFY  15
#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
#define SSL3_MT_FINISHED20
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



RE: SSL Handshake Failure !

2001-10-04 Thread Steve Quirk

I don't have the specific code, but it's not that much.  I take it that
you're issuing your own certs with the acceptable client ip in the
"subjectAltName" - you might want to allow a range.

I have similar code but not for this purpose, so let's see if I can put
them together. My code looks at the subject name, so I might be wrong in
looking for the alt name in the subject, but it's a start.


SSL *ssl;/* client SSL struct, assume this exists */

int fd, l;
struct sockaddr client_addr;
char ip_addr[4*3+3+1];
X509 *cert;
X509_NAME *subject;
char subject_ip[300];

/* get the ip of client */
fd = SSL_get_fd(ssl);
l = sizeof(struct sockaddr);
getpeername(fd, &client_addr, &l);  /* check rc! */
strcpy(ip_addr, inet_ntoa(client_addr.sin_addr));

/* look in cert for subject name? */
cert = SSL_get_peer_certificate(ssl);
subject = X509_get_subject_name(cert); /* check for NULL! */
X509_NAME_get_text_by_NID(subject, NID_subject_alt_name,
  subject_ip, 300); /* check rc! */

if (strcmp(subject_ip, client_ip) != 0)
/* mismatch! */;

X509_free(cert);  /* reduce reference count */

Steve

On Thu, 4 Oct 2001, Andy Schneider wrote:

> Does anyone have any canned code I could steal that does IP address
> validation. I.e. grabs the IP address from the alt subject name and
> compares it against the IP of the incoming socket?
>
> Andy S.
>
> > -Original Message-
> > From: Costas Magos [mailto:[EMAIL PROTECTED]]
> > Sent: 04 October 2001 15:40
> > To: [EMAIL PROTECTED]
> > Subject: SSL Handshake Failure !
> > Importance: High
> >
> >
> > Dear all,
> >
> > Sorry for posting the following again, but I am in a bit hurry.
> >
> > I'm running an Apache server (1.3.19) with openssl 0.9.6b on
> > Solaris 2.6 /
> > SPARCclassic platform. Apache serves a site that accesses a database
> > through various cgi-scripts or through a java applet for more
> > specialized
> > actions. The database is managed just fine with the
> > cgi-scripts, but when I
> > try to load the java applet to do some advanced
> > configuration, the browser
> > hangs at some point (while loading some classes) and the
> > server produces
> > the following error logs:
> >
> > [info] [client xxx.xxx.xxx.xxx] SSL accept timeout timed out
> > [error] SSL_accept failed
> >
> > and then
> >
> > [debug] apache_ssl.c(1123): Generating 512 bit key
> > [debug] apache_ssl.c(287): SSL_accept returned 0
> > [debug] apache_ssl.c(291): error:14094410:SSL
> > routines:SSL3_READ_BYTES:sslv3 alert handshake failure
> > [debug] apache_ssl.c(379): Random input /dev/random(1024) -> 1024
> > [debug] apache_ssl.c(1123): Generating 512 bit key
> > [debug] apache_ssl.c(287): SSL_accept returned 0
> > [debug] apache_ssl.c(291): error:14094410:SSL
> > routines:SSL3_READ_BYTES:sslv3 alert handshake failure
> > [debug] apache_ssl.c(379): Random input /dev/random(1024) -> 1024
> > [debug] apache_ssl.c(1123): Generating 512 bit key
> > [debug] apache_ssl.c(287): SSL_accept returned 0
> > [debug] apache_ssl.c(291): error:14094410:SSL
> > routines:SSL3_READ_BYTES:sslv3 alert handshake
> >
> > What is going on?  Could someone please help me? Any help
> > would be much
> > appreciated.
> >
> > Respectfully,
> >
> > ~~
> > Costas Magos
> > Ariadne-t Network Operation Center,
> > NCSR "Demokritos"
> > ~~
> > email: [EMAIL PROTECTED]
> > tel.: +30 1 6544279,
> > +30 1 6503125
> > fax:  +30 1 6532910
> >
> > __
> > OpenSSL Project http://www.openssl.org
> > User Support Mailing List[EMAIL PROTECTED]
> > Automated List Manager   [EMAIL PROTECTED]
> >
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing List[EMAIL PROTECTED]
> Automated List Manager   [EMAIL PROTECTED]
>

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: SSL Handshake Failure !

2001-10-04 Thread Dr S N Henson

Andy Schneider wrote:
> 
> Does anyone have any canned code I could steal that does IP address
> validation. I.e. grabs the IP address from the alt subject name and
> compares it against the IP of the incoming socket?
> 

No I don't. But in outline you need to extract and decode the subject
alt name extension (see doc/openssl.txt) this will give you a
STACK_OF(GENERAL_NAME). Then search for the ip address type and, if
found, extract and compare.

Theres a function that extracts email addresses from the subject name
and subject alt name extensions (its used by the x509 utility) which
should be easy enough to adapt.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



RE: Configuring SSL Handshake

2003-08-11 Thread Gilad Finkelstein
Hi girish,
As I said I am no wizard in ssl internals :-(
however what do you mean in negative flow ? do you refer ssl handshake
failure ?

I am now trying using the libwww-perl with the SSLeay for client
authentication against an apache server running mod_ssl (something like the
s_server util) and it should work (alas it is for https connections)
I think you should look at the SSleay.c code that comes with
CRypt-SSleay-0.5.1 it is generated by the Ssleay.xs perl wrapper and should
give you good idea on how things are done in a web application which should
not be to hard to copy into any other server.

Actually I need to learn that my self since I am now trying to enable ENGINE
openssl concept in the perl library (so that one can use hardware keys for
perl client authentication)

Sorry for not being able to be more specific but this stuff is new for me
too :-)

Gilad

-Original Message-
From: Girish Hegde [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 4:52 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Configuring SSL Handshake


Hi Gilad,

First of all let me thank you for the kind positive response.

Yes, I am using the SSLeay libraries for the handshake thing to be done, to 
test the positive flow.

But by using those APIs i cannot do the testing for negtive flow, i started 
writing a TCP/IP server(non SSL) and tried to send the messages( like 
ServerHello, ServerHelloDone etc) mannually.
I created the structures as defined in the SSL drafts in perl and  tried to 
send them to the SSL Client.

But it always says
1344:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown 
protocol:.\ssl\s23_clnt.c:475:

I even tweeked into the ssl/s23_clnt.c code, which gave me no proper reason 
why is it failing :(

I have also used the s_server.exe provided with Openssl to test some of the 
negative flows, but even that has no option to configure the handshake 
messages, like changing the sequence of messages, changing the format of 
messages, not sending some of the messages etc.

I am not using HTTPS as it is not a web application!

Can you pls let me know if i can do anything other than this to format the 
messages and send the same to the SSL client?


Thanks a lot
regards
girish


>From: Gilad Finkelstein <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" 
><[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>Subject: RE: Configuring SSL Handshake
>Date: Mon, 11 Aug 2003 13:24:33 +0200
>
>Hi Girish,
>I do not now if you can change / configure the SSL Handshake message and
>there is probably no need to do so anyway.
>There is a perl library for html (if that is your final goal) called
>libwww-perl and it uses  openssl as it's crypto and ssl engine for https
>connections
>I use it to do things like connecting to an ssl server (letting the library
>do the hard work of ssl handshake)
>The code that translate things from perl to openssl C (actually it is
>Crypt-SSLeay-05.51 but there are other alternatives) can help you figure 
>out
>how to write your own ssl handshake for non web servers (like your echo
>server).
>
>Gilad
>
>-Original Message-
>From: Girish Hegde [mailto:[EMAIL PROTECTED]
>Sent: Monday, August 11, 2003 7:17 AM
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>Subject: Configuring SSL Handshake
>
>
>Hello there,
>
>This is my 3rd or 4th request for the group. Pls if any one has any clue
>about this, reply me.
>
>I am trying to test an SSL compliant Client application with a dummy echo
>server i have written in PERL.
>Is there any way to configure the SSL Handshake messages, change the
>sequences etc?
>
>Since all these are done internally by OpenSSL, how can acheive this in
>PERL?
>
>
>Pls reply me as soon as possible..I m in a DARK ROOM AT PRESENT :((
>
>Thanks and regards
>Girish
>
>_
>Dress up your desktop! Get the best wallpapers.
>http://server1.msn.co.in/msnchannels/Entertainment/wallpaperhome.asp Just
>click here!
>
>__
>OpenSSL Project http://www.openssl.org
>Development Mailing List   [EMAIL PROTECTED]
>Automated List Manager   [EMAIL PROTECTED]
>__
>OpenSSL Project http://www.openssl.org
>Development Mailing List   [EMAIL PROTECTED]
>Automated List Manager   [EMAIL PROTECTED]

_
Dress up your desktop! Get the best wallpapers. 
http://server1.msn.co.in/msnchannels/Entertainment/wallpaperhome.asp Just 
click he

Re: Configuring SSL Handshake

2003-08-11 Thread Ng Pheng Siong
On Mon, Aug 11, 2003 at 02:51:44PM +, Girish Hegde wrote:
> But by using those APIs i cannot do the testing for negtive flow, i started 
> writing a TCP/IP server(non SSL) and tried to send the messages( like 
> ServerHello, ServerHelloDone etc) mannually.
> I created the structures as defined in the SSL drafts in perl and  tried to 
> send them to the SSL Client.

If you're sending incomplete or wrong protocol messages,

> But it always says
> 1344:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown 
> protocol:.\ssl\s23_clnt.c:475:

of course you will get "unknown protocol" responses. That's a positive
outcome for your "negative flow" testing. ;-)

What are you attempting to do and what do you expect to see when you send
protocol messages not according to protocol?

-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://firewall.rulemaker.net  -+- Manage Your Firewall Rulebase Changes
http://www.post1.com/home/ngps -+- Open Source Python Crypto & SSL
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


RE: Configuring SSL Handshake

2003-08-11 Thread Girish Hegde
Hi Gilad,

First of all let me thank you for the kind positive response.

Yes, I am using the SSLeay libraries for the handshake thing to be done, to 
test the positive flow.

But by using those APIs i cannot do the testing for negtive flow, i started 
writing a TCP/IP server(non SSL) and tried to send the messages( like 
ServerHello, ServerHelloDone etc) mannually.
I created the structures as defined in the SSL drafts in perl and  tried to 
send them to the SSL Client.

But it always says
1344:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown 
protocol:.\ssl\s23_clnt.c:475:

I even tweeked into the ssl/s23_clnt.c code, which gave me no proper reason 
why is it failing :(

I have also used the s_server.exe provided with Openssl to test some of the 
negative flows, but even that has no option to configure the handshake 
messages, like changing the sequence of messages, changing the format of 
messages, not sending some of the messages etc.

I am not using HTTPS as it is not a web application!

Can you pls let me know if i can do anything other than this to format the 
messages and send the same to the SSL client?

Thanks a lot
regards
girish

From: Gilad Finkelstein <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>,[EMAIL PROTECTED]
Subject: RE: Configuring SSL Handshake
Date: Mon, 11 Aug 2003 13:24:33 +0200

Hi Girish,
I do not now if you can change / configure the SSL Handshake message and
there is probably no need to do so anyway.
There is a perl library for html (if that is your final goal) called
libwww-perl and it uses  openssl as it's crypto and ssl engine for https
connections
I use it to do things like connecting to an ssl server (letting the library
do the hard work of ssl handshake)
The code that translate things from perl to openssl C (actually it is
Crypt-SSLeay-05.51 but there are other alternatives) can help you figure 
out
how to write your own ssl handshake for non web servers (like your echo
server).

Gilad

-Original Message-
From: Girish Hegde [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 7:17 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Configuring SSL Handshake
Hello there,

This is my 3rd or 4th request for the group. Pls if any one has any clue
about this, reply me.
I am trying to test an SSL compliant Client application with a dummy echo
server i have written in PERL.
Is there any way to configure the SSL Handshake messages, change the
sequences etc?
Since all these are done internally by OpenSSL, how can acheive this in
PERL?
Pls reply me as soon as possible..I m in a DARK ROOM AT PRESENT :((

Thanks and regards
Girish
_
Dress up your desktop! Get the best wallpapers.
http://server1.msn.co.in/msnchannels/Entertainment/wallpaperhome.asp Just
click here!
__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]
__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]
_
Dress up your desktop! Get the best wallpapers. 
http://server1.msn.co.in/msnchannels/Entertainment/wallpaperhome.asp Just 
click here!

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Re: Configuring SSL Handshake

2003-08-14 Thread Ng Pheng Siong
On Tue, Aug 12, 2003 at 05:29:10AM +, Girish Hegde wrote:
> Yes i do agree with you...I may be sending wrong protocol messages.but 
> how to make it right?

By not sending wrong protocol messages deliberately?

I don't mean to be facetious, but if you execute the protocol correctly,
you will find that the protocol, duh, executes correctly.

> >What are you attempting to do and what do you expect to see when you send
> >protocol messages not according to protocol?
> 
> I am trying to test an SSL compliant Client application. 
> For that i need to test the client behaviour
> 1. when i send correct messages as well as incorrect messages.
> 2. when i send correct messages in sequence as per the protocol definition 
> as well as sending in wrong sequences etc

And you're finding that the other side responds with "unknown protocol"
when you do that. 

Do you not expect that? If not, what are you expecting to see?


-- 
Ng Pheng Siong <[EMAIL PROTECTED]> 

http://firewall.rulemaker.net  -+- Manage Your Firewall Rulebase Changes
http://www.post1.com/home/ngps -+- Open Source Python Crypto & SSL
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Printing ssl handshake messages...

2003-11-26 Thread Sriram R
hi all, 
 Is it possible to print the ssl handshake and keys exchanged on the openssl side?..If so how?
 
thanks,
-Sriram
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

SSL Handshake question - SOLVED

2009-06-05 Thread Steve Gallivan
Flaky intermediate CA not being served up on the failed handshakes.

From: Steve Gallivan
Sent: Monday, June 01, 2009 5:51 PM
To: openssl-users@openssl.org
Subject: SSL Handshake question

Hello,

I apologize if this is an obvious NOOB question - my Google-Fu is not up to 
snuff on this one:

We're running  OpenSSL 0.9.8j 07 Jan 2009 and Server version: Apache/2.0.63 on 
a  Sunfire 280R running Solaris 9.

Clients are having intermittent problems successfully completing the SSL 
Handshake.

Running a trace on the wire revealed that the successful handshakes looked like 
this:
Client -> Server: Client Hello
Server -> Client: Server Hello
Server -> Client: Certificate
Client -> Server: Client Key Exchange
And so on, all good.

On the failures the exchange looks like this:
Client -> Server:  Client Hello
Server -> Client: Server Hello, Certificate, Server Hello Done
Client -> Server: Fatal, Description: Certificate Unknown

In running repeated tests using a java test client, we have many successful 
handshakes ( we close the socket after each one ) and then we'll hit a series 
of several failed ones, say 4-10 in a row, then it's all good again.
I'm trying to understand why the server would answer some requests with a 
"Server Hello, Certificate, Server Hello Done" all wrapped up in one packet ( 
the ones that are failing ), where most of the time it splits that out over 
several packets. The test "Client Hello" requests seem identical.

Any insights would be much appreciated.

Thanks,
Steve


RNG in SSL handshake

2010-05-19 Thread Paul Ohmart
Can anyone tell me what RNG is used in the SSL handshake in FIPS mode? 
Also what OpenSSL functions are called to get the random number. The 
Security Policy 1.1.1 documentation states that it is X9.31 but I am 
unable to locate where that happens in the source.


I am trying to use OpenSSL to generate random numbers that are X9.31 
compliant.


Thanks,
Paul
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Modifying SSL Handshake messages

2010-07-29 Thread sandeep kiran p
Hi,

Can someone tell me if there is any tool to modify the handshake messages
between client and server on the fly? For example, changing the list of
cipher suites offered by the client, changing the trusted CA names sent by
server etc. I understand that such a change would be caught by the
"finished" message, but I would like to know if any such tool really exists
that can help me modify the contents of the messages on the wire.

I know there are some tools that can capture packets on the wire, modify
them and then resend it, but thats not what I am looking for. I am looking
for something that would drop the original message and replace it
(completely or partially) with a new message.

Thanks,
Sandeep


Re: SSL handshake failure

2010-11-14 Thread Dr. Stephen Henson
On Sun, Nov 14, 2010, Timur Elzhov wrote:

> Hi, openssl experts!
> 
> It's required to transfer data to Apple Push service that is located at
> gateway.sandbox.push.apple.com:2195. I'm given the certificate and private
> key both included in Certificate_and_key.pem. Trying to connect:
> 
> $ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -CAfile
> > EntrustCA.pem -cert Certificate_and_key.pem
> 
> 
> Server's certificate is passed successfully (with CA included in
> EntrustCA.pem) but the error is following:
> 
> 140735074831484:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert
> > certificate unknown:s3_pkt.c:1193:SSL alert number 46
> 
> 140735074831484:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake
> > failure:s23_lib.c:184:
> 
> 
> I tried to google about alert 46, but found only that "something wrong with
> client's certificate". Is it possible to get more details about failure?
> 

That's all the server sends back. Is that the correct certificate for that
server?

> 
>X509v3 Extended Key Usage: critical
> 
>Code Signing
> 

Well the above extension would mean that certificate can only be used for code
signing, not SSL client authentication.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Trouble with SSL handshake

2011-05-16 Thread CoachDom
Good Morning,

My situation is very strange, i guess.

At work we use a CFT server, which is very popular in Europe for File
transfert between corporation, like bank.

In my case one of our customer is a bank, and they want that our file
transfert to be securised over SSL.

CFT include SSL support based on Openssl library and internal library.

My CFT server run under linux, an old debian i cannot upgrade due to
operationnal environment.

We need to play each other client/server role, so on both side we configured
CFT with our respective Authority certificate, and created local certificate
signed for the ssl connexion.

when i play the role of server, and our customer play the role of client,
everything runs fines and file transfert is ok.

When i play the role of client, trying to connect to our customer server, it
doesnt work.

The handshake doesnt finish.

i run an strace on my process wich manage the ssl handshake, and here is
what i got :

fcntl64(8, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0},
0xbfdef720) = 0
_llseek(8, 512, [512], SEEK_SET)= 0
fcntl64(8, F_SETLKW64, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0},
0xbfdef6e0) = 0
read(8, "\7\0\0\0\0\0\0\0\6\0\0\0REFRCA\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) =
512
fcntl64(8, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0},
0xbfdef6e0) = 0
_llseek(7, 32814, [32814], SEEK_SET)= 0
read(7, "\0UEFRLCLUS\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8193)
= 8193
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
time([1305131804])  = 1305131804
write(1, "OPNSSL.text_error(PKI2CRY:803)=e"..., 98) = 98
gettimeofday({1305131804, 420297}, NULL) = 0
gettimeofday({1305131804, 420316}, NULL) = 0
semop(2031638, 0xbfdf0fc0, 1)   = 0
semop(2031638, 0xbfdf0fc0, 1)   = 0
msgsnd(32769, {2, "\34pg\265"}, 4, 0)


But im unable to find to what error it is related !

that is why i write here, in case someone has an idea !

Regards.

--
Carrel Dominique


Get Information about SSL Handshake

2006-09-19 Thread Hubert Gressl



Hello 
Everybody!
 
I got my server and 
client running. I want to do some testing and need some information about the 
ssl handshake... whitch mechanism is used and if diffie-hellman is used what 
size of the primary secret is used?
 
I was able to get 
information about the cipher with SSL_get_cipher_version() and 
SSL_get_cipher_name() for a established connection but I couldn't figure out to 
get the information about the handshake.
 
Thanks a lot for any 
suggestions!
 
Hubert


Re: books about ssl handshake?

2007-09-10 Thread Joeri De Backer
Hello,

I have this one: http://www.opensslbook.com/

It's quite good, with a lot of programming examples etc...

Joeri

On 9/10/07, Koza <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Can you recommend any book about secure connections, ssl, handshake and the
> things alike? Would be nice if it has some reference to openssl, but it is
> not absolutely necessary.
>
> I would be grateful for any suggestions.
> Thanks,
> Koza
> --
> View this message in context: 
> http://www.nabble.com/books-about-ssl-handshake--tf4417791.html#a12600721
> Sent from the OpenSSL - User mailing list archive at Nabble.com.
>
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing Listopenssl-users@openssl.org
> Automated List Manager   [EMAIL PROTECTED]
>
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: books about ssl handshake?

2007-09-10 Thread badra
Hi Koza,

You have two good books:

Eric Rescorla, SSL and TLS, Designing and Building Secure Systems, Addison
Wesley, 2001.

John Viega, Matt Messier, Pravir Chandra
Network Security with OpenSSL Cryptography for Secure Communications

Best regards,
Badra

> Hi,
>
> Can you recommend any book about secure connections, ssl, handshake and
> the
> things alike? Would be nice if it has some reference to openssl, but it is
> not absolutely necessary.
>
> I would be grateful for any suggestions.
> Thanks,
> Koza
> --
> View this message in context:
> http://www.nabble.com/books-about-ssl-handshake--tf4417791.html#a12600721
> Sent from the OpenSSL - User mailing list archive at Nabble.com.
>
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing Listopenssl-users@openssl.org
> Automated List Manager   [EMAIL PROTECTED]
>

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: books about ssl handshake?

2007-09-10 Thread Richard Koenning

[EMAIL PROTECTED] wrote:


You have two good books:

Eric Rescorla, SSL and TLS, Designing and Building Secure Systems, Addison
Wesley, 2001.


This one explains the things the OP asked explicitly for.


John Viega, Matt Messier, Pravir Chandra
Network Security with OpenSSL Cryptography for Secure Communications


This one doesn't explain the general SSL/TLS framework, but refers for 
this to Rescorla's book. So the OP should buy first the first book and 
when after reading it, OpenSSL specific questions are still open he 
should buy the second one too.

Ciao,
Richard
--
Dr. Richard W. Könning
Fujitsu Siemens Computers GmbH
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Detect SSL handshake completion

2005-08-07 Thread Jagannadha Bhattu
Currently, it is not. OpenSSL uses engine only either for generating
random numbers or for implementing algorithms. Pl refer
http://www.openssl.org/docs/crypto/engine.html

JB

On 8/5/05, Eduri, Eswar M <[EMAIL PROTECTED]> wrote:
> 
> 
> Hello,
> 
> Is it possible for an 'engine' to detect when an SSL handshake has started
> or completed? Appreciate your help.
> 
> regards,
> 
> Eswar Eduri
> 
>
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: URGENT : SSL Handshake failed

2001-01-25 Thread John . Airey

I hope you are kidding about using mod_ssl 2.2.7. The latest version is
2.7.1, which is what you should be running.

- 
Happy new Millennium - http://www.rog.nmm.ac.uk/mill/index.htm 
John Airey 
Internet Systems Support Officer, ITCSD, Royal National Institute for the
Blind, 
Bakewell Road, Peterborough PE2 6XU, 
Tel.: +44 (0) 1733 375299 Fax: +44 (0) 1733 370848 [EMAIL PROTECTED] 
-Original Message-
From: drt rappanah [mailto:[EMAIL PROTECTED]]
Sent: 25 January 2001 14:07
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: URGENT : SSL Handshake failed
Importance: High


Hi !!

I've installed a Netscape Certificate Server 4.2sp1 on a linux mandrake
7.2 (kernel 2.2.17-21)...
I've also installed an Apache 1.3.14 server with mod_perl 1.24_01,
mod_ssl 2.2.7, php 4.0.3pl1 and openssl 0.9.6...

 
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: URGENT : SSL Handshake failed

2001-01-26 Thread drt rappanah

Thanks for your help...

The client has its certificate installed in the browser. He asked the
Netscape Certificate Server for a  certificate and then installed it in the
Browser.

Sorry, I miss someting about the authentication chain.
The Apcahe server got a certifcate from the Netscape Certificate Server.
Does the server verify the client certificate by contacting the Netscape
Certificate Server ?
Does the client verify the sever certificate by contacting the Netscape
Certificate Server ?
You suggest me to configure the SSLCACertificatePath...
What does it mean ?
Should I import all the client certificates of the Netscape Certificate
Server in the directory conf/ssl.crt ?

Regards,
Ravi APPANAH

- Original Message -
From: "Owen Boyle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:40 AM
Subject: Re: URGENT : SSL Handshake failed


> > drt rappanah wrote:
> > I can't access to the Apache web server because of this following
error :
>
> Apart from repeatedly posting your question to the list, what else have
> you done over the last few days to try to fix your problem?
>
> You are commanding the server to verify any clients who try to connect.
> So the server will ask the client for a certificate:
> - have you installed this in the browser?
>
> If so, the server will then try to authenticate the certificate it
> receives:
> - does the server have access to the CA certificate?
> - What do you have under SSLCACertificatePath?
>
> It seems to me, the server is failing to authenticate the chain
> somewhere. This is an important message:
>
> > [23/jan/2001 17:22:52 14800] [error] Certificate Verification: Error
(20): unable to get local issuer certificate
>
> And so is this one:
>
> > [23/jan/2001 17:22:52 14800] [error] OpenSSL: error:140890B2:SSL
routines:SSL3_GET_CLIENT_CERTIFICATE:no certificate returned
>
> Have a good read through
> http://www.modssl.org/docs/2.7/ssl_reference.html#ToC13 and
> http://www.modssl.org/docs/2.7/ssl_intro.html#ToC7
>
> Rgds,
>
> Owen Boyle.
> __
> Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
> User Support Mailing List  [EMAIL PROTECTED]
> Automated List Manager[EMAIL PROTECTED]
>

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



IE problems with SSL handshake

2001-02-15 Thread Joshua C. Bergeron



Greetings
 
A few weeks ago I began to look at 
possibilities into implementing
SSL into a webserver I work with.  I began by looking 
at numerous examples
(as well as ordering the SSL/TLS book I have heard so much 
about, but it
still has not arrived), and after 
a lot of playing around I am able to establish an SSLv23 handshake.
 
I am able to establish a handshake w/ OpenSSL's 's_client' 
using the -ssl3 paremeter
along with -state -debug -showcerts for debugging 
information.  no errors.  certificate
information comes up and it seems all bytes were written 
and read correctly.
 
so, it came time to load up an HTTPS client and try it 
out.  The first thing I did
was load up IE and try to pull up the page (note, right 
now that the handshake is
the only thing that is functional, it won't actually load 
up a page.)
 
IE was not able to load up the certificate information, 
and a warning box came up and said
'ssl protocol error' or something along those lines.  
Other versions of IE didn't even
give an error, but rather just a 'page cannot be 
displayed'.
 
Devestated (heh), I began to dig through the openssl-users 
archives to see what the problem
could be.  I came across a message about 
'problems with IE but netscape can load it..'
it was a message regarding mod_ssl with apache (and just 
explained some paremeters you can
pass inside httpd.conf to fix those issues) so not much 
said in the message was useful to me. 
HOWEVER i was able to load the URL 
and establish an ssl connection w/ Netscape 4.7 and Netscape 6.
It brought up the pretty certificate window and asked if i 
wanted to accept it / displayed the information
correctly.  
 
My question is:  whats the deal with IE? what do I 
need to do to fix these kind of issues?
 
a few notes:
    I'm using SSL_set_fd() on a blocking 
file descriptor for the socket.
 
    I am doing error checking on 
SSL_accept() and it seems once in a while (only in IE)
    I will get an "SSL_ERROR_SSL" from 
SSL_get_error().
 
    I thought about braving through the 
mod_ssl code to see what I could come up with
    but i thought I would check here first 
and see if you guys had any pointers.
 
 
Thanks in advance,
 
    Joshua C. Bergeron
 


doubts in Testing SSL Handshake

2003-08-01 Thread Girish Hegde
Hi there,

I am very new to SSL. I am testing a client application which is built over 
OpenSSL. I would like to write a PERL application to test the same. Is there 
any way to test the SSL Handshake stuffs?

With an SSL echo server i am able to check only the Positive flow of the 
application, but not the negative test cases.

Can anyone pls help to resolve this problem.

thanks and regards
Girish
_
Are you Unmarried? http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?4d 
Register in India's No 1 Matrimony.

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


Re: Printing ssl handshake messages...

2003-12-02 Thread Jostein Tveit
Sriram R <[EMAIL PROTECTED]> writes:

> Is it possible to print the ssl handshake and keys exchanged
> on the openssl side?..If so how?

I recommend using ssldump http://www.rtfm.com/ssldump/ >.

-- 
Jostein Tveit ([EMAIL PROTECTED])
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]


SSL Handshake failure (openssl-0.9.1c)

1999-03-24 Thread Leonid Elbert

Dear sirs,
The following errors I got during a try to connect to a https site.
>
>SSLeay>s_client -host www.srd.com -port 443
>CONNECTED(0003)
>depth=0 /C=US/ST=Ohio/L=Columbus/O=Securities Registration Depository,
>Inc./OU=Securities Registration Depository
>, Inc./CN=www.srd.com
>verify error:num=20:unable to get local issuer certificate
>verify return:1
>depth=0 /C=US/ST=Ohio/L=Columbus/O=Securities Registration Depository,
>Inc./OU=Securities Registration Depository
>, Inc./CN=www.srd.com
>verify error:num=21:unable to verify the first certificate
>verify return:1
>4102:error:140790E3:SSL routines:SSL23_WRITE:ssl handshake
failure:s23_lib.c:224:
>
Could you please advice me why do I get these errors and how can I avoid
them in the future? (I have no problem with accessing this site from
Netscape or InternetExplorer.)
Also -- this site uses 128-bit encryption. Does the openSSL handle it?
Or maybe I shall install some more modules? (Which ones in that case?)

Thank you in advance for your reply.

Sincerely,
Leonid Elbert.

P.S. I use openssl-0.9.1c installed on Linux RH 5.1
Also, the following warnings had occured during the openssl installation

--
>
>read_pwd.c: In function `des_read_pw':
>read_pwd.c:226: warning: variable `number' might be clobbered by
`longjmp' or `vfork'
>read_pwd.c:227: warning: variable `ok' might be clobbered by `longjmp'
or `vfork'
>read_pwd.c:228: warning: variable `ps' might be clobbered by `longjmp'
or `vfork'
>read_pwd.c:229: warning: variable `is_a_tty' might be clobbered by
`longjmp' or `vfork'
>read_pwd.c:231: warning: variable `tty' might be clobbered by `longjmp'
or `vfork'
>read_pwd.c:307: warning: variable `in' might be clobbered by `longjmp'
or `vfork'
>read_pwd.c:317: warning: variable `in' might be clobbered by `longjmp'
or `vfork'
>
Maybe that also causes the openssl to malfunction. In that case -- how
can I avoid them?

Leonid.

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Client Puzzle during SSL handshake

2009-05-31 Thread neha gupta
Hello I want to implement ssl with client puzzle ( After the client hello
and server hello , server will send puzzle req and further step will take
place if server would get correct puzzle reply from client)
Till now i have directly used ssl_connect function but now i need to support
client puzzle. But i m not getting actually how ssl_connect code is
implemented ( i didnt find its code) and how introduce puuzle steps in it.
so any suggestion how to do ?


ssl handshake failure: s23_l.c:188

2009-06-24 Thread Robert Jacobson


I'm having a problem with Firefox connecting to a web site at work.  I found 
that openssl also has problems with it.  I can connect with other browsers like 
IE, Chrome, and Safari.

There is a Firefox bug report, but no one is working on it.  See:
https://bugzilla.mozilla.org/show_bug.cgi?id=448303


Here is the openssl s_client output:

# openssl s_client -connect cds.gsfc.nasa.gov:443
CONNECTED(0003)
depth=0 /C=US/ST=Maryland/L=Greenbelt/O=National Aeronautics and Space 
Administration/OU=CDS / Code 444/CN=*.gsfc.nasa.gov
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /C=US/ST=Maryland/L=Greenbelt/O=National Aeronautics and Space 
Administration/OU=CDS / Code 444/CN=*.gsfc.nasa.gov
verify error:num=27:certificate not trusted
verify return:1
depth=0 /C=US/ST=Maryland/L=Greenbelt/O=National Aeronautics and Space 
Administration/OU=CDS / Code 444/CN=*.gsfc.nasa.gov
verify error:num=21:unable to verify the first certificate
verify return:1
5008:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake 
failure:s23_lib.c:188:


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: RNG in SSL handshake

2010-05-19 Thread Dr. Stephen Henson
On Tue, May 18, 2010, Paul Ohmart wrote:

> Can anyone tell me what RNG is used in the SSL handshake in FIPS mode? Also 
> what OpenSSL functions are called to get the random number. The Security 
> Policy 1.1.1 documentation states that it is X9.31 but I am unable to 
> locate where that happens in the source.
>
> I am trying to use OpenSSL to generate random numbers that are X9.31 
> compliant.
>

OpenSSL uses the default PRNG implementation for all operations including
SSL/TLS, though in FIPS mode only TLS is permissible.

When you enter FIPS mode the default PRNG is set to the FIPS PRNG so TLS uses
the FIPS PRNG.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Memory issues with ssl handshake

2012-09-12 Thread Thomas Eckert

Hi,

Valgrind gives me a *lot* of messages like this

==19021== 2,056 bytes in 2 blocks are indirectly lost in loss record 186 
of 190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73BB2: BN_set_bit (bn_lib.c:730)
==19021==by 0x6C7E16E: BN_MONT_CTX_set (bn_mont.c:514)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

Compared to the above they vary only in one line, e.g.

==19021== 1,024 bytes in 2 blocks are indirectly lost in loss record 181 
of 190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73D53: BN_copy (bn_lib.c:506)
==19021==by 0x6C7DFCA: BN_MONT_CTX_set (bn_mont.c:421)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

The application in question is a http proxy and is leaking memory 
heavily. Actually, Valgrind also reports many entries as "still 
reachable" instead of "indirectly lost" but even those regions are 
mentioned by Valgrind like the above two blocks.


I doubt OpenSSL has such blatant memory leaks but I have been searching 
for the leaks for some time now and just cannot find anything - also due 
to the fact that Valgrind reports all the leaks like above, which is not 
really helpful. I do realize that for detailed help I would need to give 
some code on how the connections are set up but that code is pretty 
large. So best would be some hint as to where to look for or what 
regions of code to supply.


Looking for hints as to what is going wrong I went through some of the 
OpenSSL functions mentioned above and after "leaving my code" and 
entering OpenSSL code the only thing being passed around the functions 
is the actual SSL object - and no buffers of any kind. So I suppose the 
source of the problem lies in setting up the object, it's context or 
what ever is stuck to it.


The first thing I checked on was how the SSL connections are torn down 
in my application:

   ERR_remove_state(0);
   SSL_CTX_free(ssl->ctx);
   SSL_free(ssl);
The first line was added only after starting the search for the leaks 
and I'm still not sure if that line doesn't break anything.


I did find some minor leaks in my code along the way (e.g. a forgotten 
ASN1_INTEGER_free()) but they were neither easy to find - because 
Valgrind also reported them like the above two blocks, meaning in the 
wrong place! - nor did they change much.


Does anyone have some tips for me ?
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Get Information about SSL Handshake

2006-09-19 Thread Marek Marcola
Hello, 
> Hello Everybody!
>  
> I got my server and client running. I want to do some testing and need
> some information about the ssl handshake... whitch mechanism is used
> and if diffie-hellman is used what size of the primary secret is used?
>  
> I was able to get information about the cipher with
> SSL_get_cipher_version() and SSL_get_cipher_name() for a established
> connection but I couldn't figure out to get the information about the
> handshake.
Peer RSA/DSA parameters used in handshake may be printed
for example with code:

EVP_PKEY *pkey;
X509 *cert;

cert = SSL_get_peer_certificate(ssl);

if ((cert != NULL) && ((pkey = X509_get_pubkey(cert)) != NULL)) {
   if (pkey->type == EVP_PKEY_RSA && pkey->pkey.rsa != NULL 
   && pkey->pkey.rsa->n != NULL) {
  printf("RSA-%d\n", BN_num_bits(pkey->pkey.rsa->n));
   }
   if (pkey->type == EVP_PKEY_DSA && pkey->pkey.dsa != NULL
   && pkey->pkey.dsa->p != NULL) {
  printf("DSA-%d\n", BN_num_bits(pkey->pkey.dsa->p));
   }
}

if (cert != NULL) {
   X509_free(cert);
}

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Get Information about SSL Handshake

2006-09-19 Thread Hubert Gressl
Thank you very much this works fine but how do I get the information if
diffie hellman (DH) is used to negotiate the key?

I wanted to compare the differnce in cpu consumption and time delay if
session reuse is used or not! (Keyexchange with Diffie Hellman)
Therefore I set:
 
SSL_CTX_set_session_cache_mode( ctx, SSL_SESS_CACHE_OFF );

If I connect to the server there is a delay fore about 20 seconds but the
server doesn't consume any cpu in this time, just the client... Shouldn't
the server waste some CPU while computing his key? 

Do you the approximate delay if session reuse is not used?
Furthermore, it would be great to display the DH secret length somehow?

Thanks a lot for any suggestions!
Best Regards
Hubert


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Marek Marcola
Gesendet: Dienstag, 19. September 2006 22:00
An: openssl-users@openssl.org
Betreff: Re: Get Information about SSL Handshake

Hello, 
> Hello Everybody!
>  
> I got my server and client running. I want to do some testing and need 
> some information about the ssl handshake... whitch mechanism is used 
> and if diffie-hellman is used what size of the primary secret is used?
>  
> I was able to get information about the cipher with
> SSL_get_cipher_version() and SSL_get_cipher_name() for a established 
> connection but I couldn't figure out to get the information about the 
> handshake.
Peer RSA/DSA parameters used in handshake may be printed for example with
code:

EVP_PKEY *pkey;
X509 *cert;

cert = SSL_get_peer_certificate(ssl);

if ((cert != NULL) && ((pkey = X509_get_pubkey(cert)) != NULL)) {
   if (pkey->type == EVP_PKEY_RSA && pkey->pkey.rsa != NULL 
   && pkey->pkey.rsa->n != NULL) {
  printf("RSA-%d\n", BN_num_bits(pkey->pkey.rsa->n));
   }
   if (pkey->type == EVP_PKEY_DSA && pkey->pkey.dsa != NULL
   && pkey->pkey.dsa->p != NULL) {
  printf("DSA-%d\n", BN_num_bits(pkey->pkey.dsa->p));
   }
}

if (cert != NULL) {
   X509_free(cert);
}

Best regards,
--
Marek Marcola <[EMAIL PROTECTED]>

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Get Information about SSL Handshake

2006-09-20 Thread Marek Marcola
Hello,
> Thank you very much this works fine but how do I get the information if
> diffie hellman (DH) is used to negotiate the key?
> 
> I wanted to compare the differnce in cpu consumption and time delay if
> session reuse is used or not! (Keyexchange with Diffie Hellman)
> Therefore I set:
>  
>   SSL_CTX_set_session_cache_mode( ctx, SSL_SESS_CACHE_OFF );
> 
> If I connect to the server there is a delay fore about 20 seconds but the
> server doesn't consume any cpu in this time, just the client... Shouldn't
> the server waste some CPU while computing his key? 
> 
> Do you the approximate delay if session reuse is not used?
> Furthermore, it would be great to display the DH secret length somehow?
I've attached modified test client which tries to
display some peer DH parameters ...
 I'm sure that this may be done easer :-)

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>
#include 

#include 

#define SSL_PKEY_NUM6

typedef struct cert_pkey_st
{
	X509 *x509;
	EVP_PKEY *privatekey;
} CERT_PKEY;


typedef struct sess_cert_st
{
	STACK_OF(X509) * cert_chain;	/* as received from peer (not for SSL2) */

	/* The 'peer_...' members are used only by clients. */
	int peer_cert_type;

	CERT_PKEY *peer_key;		/* points to an element of peer_pkeys (never NULL!) */
	CERT_PKEY peer_pkeys[SSL_PKEY_NUM];
	/* Obviously we don't have the private keys of these,
	 * so maybe we shouldn't even use the CERT_PKEY type here. */

#ifndef OPENSSL_NO_RSA
	RSA *peer_rsa_tmp;			/* not used for SSL 2 */
#endif
#ifndef OPENSSL_NO_DH
	DH *peer_dh_tmp;			/* not used for SSL 2 */
#endif
#ifndef OPENSSL_NO_ECDH
	EC_KEY *peer_ecdh_tmp;
#endif

	int references;/* actually always 1 at the moment */
} SESS_CERT;


#define CA_FILE	"./cacert.pem"
#define CERT_FILE	"./cert.pem"
#define KEY_FILE	"./key.pem"

/**
 * TLS connection info callback.
 *
 * @paramssl TLS connection socket
 * @paramtypeconnection type
 * @paramval connection info
 * @return   none
 */
static void tls_connection_info_cb(const SSL * ssl, int type, int val)
{
	if (type & SSL_CB_LOOP) {
		printf("tls_state: %s: %s\n",
			   type & SSL_ST_CONNECT ? "connect" :
			   type & SSL_ST_ACCEPT ? "accept" : "undefined", SSL_state_string_long(ssl));
	}
	if (type & SSL_CB_ALERT) {
		printf("tls_alert: %s:%s: %s\n",
			   type & SSL_CB_READ ? "read" : "write",
			   SSL_alert_type_string_long(val), SSL_alert_desc_string_long(val));
	}
}

int main()
{
	BIO *bio;
	SSL *ssl;
	SSL_CTX *ctx = NULL;

	//char *ciph = "AES256-SHA:AES128-SHA";
	char *ciph = "DHE-RSA-AES256-SHA";

	SSL_load_error_strings();
	SSLeay_add_ssl_algorithms();

	RAND_load_file("/dev/urandom", 1024);

	printf("crypto lib: %s\n", SSLeay_version(SSLEAY_VERSION));

	if ((ctx = SSL_CTX_new(SSLv23_method())) == NULL) {
		goto err;
	}

	SSL_CTX_set_verify_depth(ctx, 4);

	if (SSL_CTX_load_verify_locations(ctx, CA_FILE, NULL) != 1) {
		goto err;
	}

	if (SSL_CTX_set_default_verify_paths(ctx) != 1) {
		goto err;
	}

	if (SSL_CTX_use_certificate_chain_file(ctx, CERT_FILE) != 1) {
		goto err;
	}

	if (SSL_CTX_use_PrivateKey_file(ctx, KEY_FILE, SSL_FILETYPE_PEM) <= 0) {
		goto err;
	}

	if (!SSL_CTX_check_private_key(ctx)) {
		goto err;
	}

	SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);

	if (SSL_CTX_set_cipher_list(ctx, ciph) != 1) {
		goto err;
	}

	SSL_CTX_set_info_callback(ctx, tls_connection_info_cb);

	if ((bio = BIO_new_connect("127.0.0.1:10443")) == NULL) {
		goto err;
	}

	if (BIO_do_connect(bio) <= 0) {
		goto err;
	}

	if ((ssl = SSL_new(ctx)) == NULL) {
		goto err;
	}

	SSL_set_bio(ssl, bio, bio);

	if (SSL_connect(ssl) <= 0) {
		goto err;
	}

	printf(" the cipher used by the client : %s\n", SSL_get_cipher(ssl));

	struct sess_cert_st *sc = ssl->session->sess_cert;

	if (sc->peer_dh_tmp != NULL) {
		printf("Peer DH parameters:\n");
		if (sc->peer_dh_tmp->p != NULL) {
			printf("  p: %d bits\n", BN_num_bits(sc->peer_dh_tmp->p));
			printf(" %s\n", BN_bn2hex(sc->peer_dh_tmp->p));
		}
		if (sc->peer_dh_tmp->g != NULL) {
			printf("  g: %d bits\n", BN_num_bits(sc->peer_dh_tmp->g));
			printf(" %s\n", BN_bn2hex(sc->peer_dh_tmp->g));
		}
		if (sc->peer_dh_tmp->pub_key != NULL) {
			printf("  pub_key: %d bits\n", BN_num_bits(sc->peer_dh_tmp->pub_key));
			printf(" %s\n", BN_bn2hex(sc->peer_dh_tmp->pub_key));
		}
	}

	if (SSL_write(ssl, "test 123\n", 9) <= 0) {
		goto err;
	}

	SSL_shutdown(ssl);

	return (0);

  err:
	if (ctx != NULL) {
		SSL_CTX_free(ctx);
	}
	ERR_print_errors_fp(stderr);
	return (1);
}


SSL handshake failed - 14090086 and 14095412

2007-02-28 Thread caplechu

Hello,

I have an application that use SSL protocol, for this we have made a test
certificate with Verisign and we have installed the CA Certificate, the
private key and the public certificate in the server. We use Vitria that
inside runs on Java.

When we try to connect to it from IE or Mozilla all things go well, I see
the certificate and if I accept it all goes well. The problem is when we try
to connect between machines the client shows this error:
Component HTTP Target: [message id: ] Using
'https://servitria2:20999/Service-initial/receiverTest?Orden=Nueva+orden' to
make request.
Peer certificate verification failed. Reason code: 2.
Component HTTP Target: Could not create SSL socket.
com.vitria.connectors.http.HTTPConnectionException:
HttpsTargetConnector-Project testHTTPConnector: Component HTTP Target: Could
not create SSL socket.
 
com.vitria.connectors.http.HttpTargetConnector.getSSLSocket(HttpTargetConnector.java:575)
  --- The linked exception is --- 
  java.net.SocketException: Xport: SSL handshake failed: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  com.vitria.roi.javanative.VTSocketImpl.connect(VTSocketImpl.java:118)
  com.vitria.roi.javanative.VTSocket.(VTSocketFactory.java:112)

In the server I see this log:
SSL handshake failed: error:14095412:SSL routines:SSL3_READ_BYTES:sslv3
alert bad certificate
  vtsslcred.cxx:1010

The server certificate is like this (its path):
Verisign Trial Server Server Test Root CA
Verisign Trial Server Server Test CA
servitria2

Any clue will be appreciated but really appreciated because we have serious
problems in our application.
Thanks to all
-- 
View this message in context: 
http://www.nabble.com/SSL-handshake-failed---14090086-and-14095412-tf3308472.html#a9202852
Sent from the OpenSSL - User mailing list archive at Nabble.com.

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


How to dump SSL Handshake messages?

2008-01-11 Thread Vicky Ven
Hi,

I need to the capture the SSL handshake messages between my client
application and server.
How do we dump detailed SSL Handshake messages? Does OpenSSL offer some
means?

Thanks,
Vicky


[error] SSL handshake interrupted by system

2000-10-02 Thread Brian T. Allen

Hi *,

I am getting a lot of errors when trying to use SSL with Apache.  It has
been configured and working for months, but with errors the whole time.

In the browser, you simply get a "Page not found" error.  The following
shows up in the logs:


[02/Oct/2000 07:55:11 00655] [error] SSL handshake interrupted by system
[Hint: Stop button pressed in browser?!] (System error follows)
[02/Oct/2000 07:55:11 00655] [error] System: Connection reset by peer
(errno: 104)


There is no discernable pattern to this.  Sometimes it happens, sometimes it
doesn't.  There are about 5 pages you go through to checkout on our site,
and you will usually get this error on one of them, randomly.  If you keep
hitting refresh or back, eventually you will get to the page.  This disrupts
the flow of information on the site, as the variables don't get passed from
the form when this happens.

Any ideas?  It is on RH 6.1, Apache 1.3.12, OpenSSL 0.9.6, and ModSSL
2.6.6-1.3.12.  I installed months ago, and had this problem, so I
re-installed last week and the problem still exists.

Thanks,
Brian

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



SSL handshake fails - 51 bytes unread

2001-01-19 Thread Quickling

Hi,


The problem happens most obviously when connecting large numbers
of sockets at once, and it happens on the accepting (server) side.
In the example where I have a test client application opening 500
sockets at maximum speed to a test server, almost every single
connection will get set up properly and begin communicating
quite well.  But there's a few that end badly, not because of an
SSL error but because I seem to get out of sync with what SSL
needs.  Every time, things break down because there's data
waiting on the socket that SSL doesn't read.  In every case
this fails, FIONREAD tells me 51 bytes before read, 51 after.
This can happen during the setup phase, where I am calling
SSL_accept; in these cases SSL_accept() never returns 1, tells
me SSL_ERROR_WANT_READ, yet stops reading from the socket.
The other case, which happens less often, is that immediately
after SSL_accept() returns 1 and I mark the connection as
being ready for business, I will get 51 bytes on the socket
- yet my test client has not yet started sending data; the
51 bytes are apparently left over from negotiation, sent by
SSL on the client side, despite SSL_accept() on my side
thought the negotiation was successful.

MY CODE:
I'm using OpenSSL on non-blocking sockets, using a few threads to
handle select loops and event handling.  All critical sections
are threadsafe, including calls to SSL; no overlapping calls
are possible.  I need to handle well over 1000 active SSL
connections, so things are performance tuned.  I use a per-
connection status indicator to know what SSL action is
pending each time I get a network event.  These are the states
I handle (probably overkill but I wasn't sure of all the
possible cases so covered all indicated, OnReceive and OnSend
are my FD_READ/FD_WRITE select event handlers):

* setup:+ an OnReceive SSL_accept() or SSL_connect() is pending
   setup:+ an OnSend SSL_accept() or SSL_connect() is pending
   shutdown: + an OnReceive SSL_shutdown() is pending
   shutdown: + an OnSend SSL_shutdown() is pending
   writing:  + an OnReceive SSL_write() is pending
* writing:  + an OnSend SSL_write() is pending
* reading:  + an OnReceive SSL_read() is pending
   reading:  + an OnSend SSL_read() is pending

The stars indicate states I know for sure happen.

I'm using the 0.9.6 release of SSL on the Win32 platform with
tests running on Win2K Pro.  All my code is C++.


Any thoughts are appreciated - cheers.

Jesse

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: SSL Handshake failure (openssl-0.9.1c)

1999-03-24 Thread Bodo Moeller

Leonid Elbert <[EMAIL PROTECTED]>:

> The following errors I got during a try to connect to a https site.

>> SSLeay>s_client -host www.srd.com -port 443
[...]
>> 4102:error:140790E3:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:224:

It works with
 s_client -host www.srd.com -port 443 -cipher RC4-MD5 -ssl2
(but not with -ssl3 or -tls1), so the server software is probably
quite old and possibly buggy.

>> Also -- this site uses 128-bit encryption. Does the openSSL handle it?

In the above command line, RC4-MD5 indicates a 128-bit symmetric
cipher (the weak ones have "EXP-" in their OpenSSL name).
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: ssl handshake failure: s23_l.c:188

2009-06-24 Thread Victor Duchovni
On Wed, Jun 24, 2009 at 08:48:28PM -0400, Robert Jacobson wrote:

>
> I'm having a problem with Firefox connecting to a web site at work.  I 
> found that openssl also has problems with it.  I can connect with other 
> browsers like IE, Chrome, and Safari.
>
> There is a Firefox bug report, but no one is working on it.  See:
> https://bugzilla.mozilla.org/show_bug.cgi?id=448303
>
>
> Here is the openssl s_client output:
>
> # openssl s_client -connect cds.gsfc.nasa.gov:443
> CONNECTED(0003)
> depth=0 /C=US/ST=Maryland/L=Greenbelt/O=National Aeronautics and Space 
> Administration/OU=CDS / Code 444/CN=*.gsfc.nasa.gov
> verify error:num=20:unable to get local issuer certificate
> verify return:1
> depth=0 /C=US/ST=Maryland/L=Greenbelt/O=National Aeronautics and Space 
> Administration/OU=CDS / Code 444/CN=*.gsfc.nasa.gov
> verify error:num=27:certificate not trusted
> verify return:1
> depth=0 /C=US/ST=Maryland/L=Greenbelt/O=National Aeronautics and Space 
> Administration/OU=CDS / Code 444/CN=*.gsfc.nasa.gov
> verify error:num=21:unable to verify the first certificate
> verify return:1
> 5008:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake 
> failure:s23_lib.c:188:

The server is misconfigured, it advertises support for ciphers that
it fails to properly implement. If you exclude the 256-bit AES
ciphers:

openssl s_client -connect cds.gsfc.nasa.gov:443 \
-cipher 'DEFAULT:!DHE-RSA-AES256-SHA:!DHE-DSS-AES256-SHA:!AES256-SHA'

the connection works. My guess is that the server is a SunOS (5.10?)
system with Sun's libcrypto containing AES 128 and no AES256, and you
have configured a non-default server cipherlist.

If Sun upgrade to a more recent OpenSSL version, the partly implemented
AES suite will work even with a non-default cipherlist.

-- 
Viktor.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


SSL Handshake - Server/Client Write Keys

2010-05-11 Thread Steffan, Nate
Hello,

 

I need to access the server write key and client write key that is generated
during the SSL Handshake and I am struggling on how one might do this.  I am
wondering if anyone has either done this or knows where I should be looking?
It looks like they get passed into the cipher, but I do not know how they
are stored. 

 

Thanks,

Nate Steffan 



smime.p7s
Description: S/MIME cryptographic signature


SSL Handshake - Server/Client Write Keys

2010-05-11 Thread Steffan, Nate
Hello,

 

I need to access the server write key and client write key that is generated
during the SSL Handshake and I am struggling on how one might do this.  I am
wondering if anyone has either done this or knows where I should be looking?
It looks like they get passed into the cipher, but I do not know how they
are stored. 

 

Thanks,

Nate Steffan 



smime.p7s
Description: S/MIME cryptographic signature


Getting detailed ssl-handshake debug output

2010-10-08 Thread Jeff Saremi
 I'd like to know if there's a way -- programmatic, config, environment
-- that I can get detailed print of what goes on during a handshake at
the client or the server? Below is the output from Apache Tomcat as an
example of the level of details i'm looking for:

http-442-1, READ: TLSv1 Handshake, length = 73
*** ClientHello, TLSv1
RandomCookie:  GMT: 1269551866 bytes = { 178, 23, 135, 211, 154, 110,
144, 59, 9
9, 139, 224, 45, 156, 231, 232, 123, 36, 95, 187, 165, 56, 121, 211, 63,
117, 43
, 7, 82 }
Session ID:  {}
Cipher Suites: [TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_DSS_WITH_AES_256_CBC_S
HA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
SSL_DHE_DSS
_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA,
TLS_DHE_RSA_WITH_AES_128_
CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA,
SSL_RSA
_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, Unknown 0x0:0xff]
Compression Methods:  { 0 }
Unsupported extension type_35, data:
***
%% Created:  [Session-1, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA]
*** ServerHello, TLSv1
RandomCookie:  GMT: 1269551766 bytes = { 32, 121, 10, 209, 123, 137,
160, 183, 1
86, 107, 255, 108, 79, 16, 190, 91, 180, 86, 18, 136, 232, 108, 249,
191, 90, 17
6, 87, 231 }
Session ID:  {76, 172, 211, 150, 251, 114, 230, 220, 75, 218, 174, 105,
134, 185
, 144, 119, 92, 182, 1, 58, 247, 172, 121, 90, 212, 100, 58, 220, 93,
76, 97, 11
1}
Cipher Suite: SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Compression Method: 0
***
Cipher suite:  SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
*** Certificate chain
chain [0] = [
[
  Version: V1
  Subject: OU=Tomcat, O=ACME, emailaddress=tom...@acme.com, C=CA,
CN=localhost
  Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
 
  Key:  Sun RSA public key, 512 bits
  modulus:
973285574783538290665814718553460486271776249697428968977460338357983
...
  public exponent: 65537
  Validity: [From: Mon Jun 21 14:33:25 EDT 2010,
   To: Tue Jun 21 14:33:25 EDT 2011]
  Issuer: OU=Root CA, O=ACME Systems Inc., L=TEST PURPOSES ONLY, C=CA,
CN=ACME Systems Root CA
  SerialNumber: [02]
 
]
  Algorithm: [SHA1withRSA]
  Signature:
: A5 A9 E6 5F BE 51 75 E5   E3 25 9D 92 AB 45 FA 1E  ..._.Qu..%...E..
...
 
]
***
*** Diffie-Hellman ServerKeyExchange
DH Modulus:  { 233, 230, 66, 89, 157, 53, 95, 55, 201, 127, 253, 53,
103, 18, 11
... }
DH Base:  { 48, 71, 10, 213, 160, 5, 251, 20, 206, 45, 157, 205, 135,
227, 139,
... }
Server DH Public Key:  { 159, 193, 69, 114, 138, 167, 128, 50, 5, 51,
77, 127, 2
...}
Signed with a DSA or RSA public key
*** CertificateRequest
Cert Types: RSA, DSS
Cert Authorities:



*** ServerHelloDone
http-442-1, WRITE: TLSv1 Handshake, length = 1544
http-442-1, READ: TLSv1 Handshake, length = 3309
*** Certificate chain
chain [0] = [
[
  Version: V3
  Subject: CN=fd0172c2-3f02-432e-8317-097b8fabff7d, OU=Windows/1.00,
O=instance
  Signature Algorithm: SHA256withRSA, OID = 1.2.840.113549.1.1.11
 
  Key:  Sun RSA public key, 1024 bits
  modulus:
128531339772544414974300233324968135333513753311766363920169114394683
...
 
  public exponent: 65537
  Validity: [From: Tue Oct 05 17:49:02 EDT 2010,
   To: Wed Oct 05 17:49:02 EDT 2011]
  Issuer: CN=TESTActivationCA, OU=Activation CA, O=TEST ACTIVATION
  SerialNumber: [012b7e5e 79df]

[2]: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
  CN=guest, OU=ACME PC Client, O=instance
]
 
[3]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
  DigitalSignature
  Key_Encipherment
  Key_Agreement
]
 
[4]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
  CA:false
  PathLen: undefined
]
 
]
  Algorithm: [SHA256withRSA]
  Signature:
: 97 32 64 63 D4 DA ED AF   CD 7F EC 77 A6 7C 72 85  .2dc...w..r.
...
 
]
chain [1] = [
[
  Version: V3
  Subject: CN=TESTActivationCA, OU=Activation CA, O=TEST ACTIVATION
  Signature Algorithm: SHA256withRSA, OID = 1.2.840.113549.1.1.11
 
  Key:  Sun RSA public key, 2048 bits
  modulus:
241401315179803415263681113133745704037912047640810783616090692543408
...
  public exponent: 65537
  Validity: [From: Wed Jun 09 14:04:45 EDT 2010,
   To: Thu Jun 09 14:04:45 EDT 2011]
  Issuer: OU=Root CA, O=ACME Systems Inc., L=TEST PURPOSES ONLY, C=CA,
CN=ACME Systems Root CA
  SerialNumber: [01]
 
Certificate Extensions: 6
[1]: ObjectId: 2.5.29.30 Criticality=true
NameConstraints: [
Permitted:   GeneralSubtrees:
[
   GeneralSubtree: [
GeneralName: O=instance
Minimum: 0  Maximum: undefined]
]
   ]
 
[2]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
: 7C FB 2B 96 C9 0D 37 89   01 83 D9 5A 67 41 3B 3C  ..+...7ZgA;<
0010: E7 45 81 43.E.C
]
]
 
[3]: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
: 70 8F 22 BC D7 55 20 6E   00 D7 3A D3 70 40 F5 49  p."..U n..:@.i
0010: 91 20 90 60. .`
]
 
[OU=Root CA, O=ACME Systems Inc., L=TEST PURPOSES ONLY, C=C

ssl handshake with multiple tcp connect?

2011-08-25 Thread Arjan Filius


Hello,

today i ran into a situation, where i notice firefox/chrome and 
gnutls-cli use 3 tcp sessions to get a single ssl session, where openssl 
s_client takes only one.


one tcp session is what i expect, and i hope someone may have an 
explanation.


compared the gnutls-cli with openssl s_client as thay would do no http 
interpretation, and are easely reproduced by commandline:


gnutls-cli  --insecure -V -r www.xs4all.nl Any idea how that may come? until now, i was under the impression a ssl 
session setup should only use 1 tcp session (apart from ocsp/crl checks)


Thanks in advance

Regards,
--
Arjan Filius
mailto:iafil...@xs4all.nl
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


how to see the SSL handshake

2011-12-28 Thread Mithun Kumar
Hello Forum,

I am currently running the samples(client1,server1) , is there any
environmental variables that i need to export so that i can get the SSL
handshake tracing?

-Thanks
 mithun


HTTPS connection hangs during SSL handshake

2012-09-04 Thread Supratik Goswami
I am using OpenSSL version : openssl-1.0.0j in our production.

I am facing a strange problem where the SSL connection simply hangs
during initial handshake when requested from our office IP address.
When I run the same command from another IP address it works fine.

>From office IP (Unsuccessful connection):

[root@gateway ]# openssl s_client -connect test.mydomain.com:443
CONNECTED(0003)


>From a different IP (Successful connection):

ubuntu@ip-10-0-0-10 (Development):~$ openssl s_client -connect
test.mydomain.com:443
CONNECTED(0003)
depth=3 /L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert
Class 2 Policy Validation
Authority/CN=http://www.valicert.com//emailAddress=i...@valicert.com
verify error:num=19:self signed certificate in certificate chain
verify return:0
---
Certificate chain
 0 s:/O=*.mydomain.com/OU=Domain Control Validated/CN=*.mydomain.com
   i:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com,
Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure
Certification Authority/serialNumber=07969287
 1 s:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com,
Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure
Certification Authority/serialNumber=07969287
   i:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2
Certification Authority
 2 s:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2
Certification Authority
   i:/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class
2 Policy Validation
Authority/CN=http://www.valicert.com//emailAddress=i...@valicert.com
 3 s:/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class
2 Policy Validation
Authority/CN=http://www.valicert.com//emailAddress=i...@valicert.com
   i:/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class
2 Policy Validation
Authority/CN=http://www.valicert.com//emailAddress=i...@valicert.com
---
Server certificate
-BEGIN CERTIFICATE-

REMOVED FOR SECURITY REASON

-END CERTIFICATE-
subject=/O=*.mydomain.com/OU=Domain Control Validated/CN=*.mydomain.com
issuer=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com,
Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure
Certification Authority/serialNumber=07969287
---
No client certificate CA names sent
---
SSL handshake has read 4827 bytes and written 435 bytes
---
New, TLSv1/SSLv3, Cipher is RC4-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol  : TLSv1
Cipher: RC4-SHA
Session-ID: 276ADBFB75336E7E870C5E109B4C5F6AFB8328C8775029EF135C5DA6F8608533
Session-ID-ctx:
Master-Key:
22B470A67XXXB50ED6237BE9
Key-Arg   : None
Start Time: 1346765613
Timeout   : 300 (sec)
Verify return code: 19 (self signed certificate in certificate chain



Any ideas ?


-- 
Warm Regards

Supratik
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


RE: Memory issues with ssl handshake

2012-09-12 Thread Charles Mills
Not sure if it help at all but FWIW I am using Windows pre-built OpenSSL
dll's with server & client certificates, CAs, DH keys, and a CRL, and I am
seeing no memory leaks whatsoever in Visual Studio 2010.

Charles

-Original Message-
From: owner-openssl-us...@openssl.org
[mailto:owner-openssl-us...@openssl.org] On Behalf Of Thomas Eckert
Sent: Wednesday, September 12, 2012 7:59 AM
To: openssl-users@openssl.org
Subject: Memory issues with ssl handshake

Hi,

Valgrind gives me a *lot* of messages like this

==19021== 2,056 bytes in 2 blocks are indirectly lost in loss record 186 of
190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73BB2: BN_set_bit (bn_lib.c:730)
==19021==by 0x6C7E16E: BN_MONT_CTX_set (bn_mont.c:514)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

Compared to the above they vary only in one line, e.g.

==19021== 1,024 bytes in 2 blocks are indirectly lost in loss record 181 of
190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73D53: BN_copy (bn_lib.c:506)
==19021==by 0x6C7DFCA: BN_MONT_CTX_set (bn_mont.c:421)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

The application in question is a http proxy and is leaking memory heavily.
Actually, Valgrind also reports many entries as "still reachable" instead of
"indirectly lost" but even those regions are mentioned by Valgrind like the
above two blocks.

I doubt OpenSSL has such blatant memory leaks but I have been searching for
the leaks for some time now and just cannot find anything - also due to the
fact that Valgrind reports all the leaks like above, which is not really
helpful. I do realize that for detailed help I would need to give some code
on how the connections are set up but that code is pretty large. So best
would be some hint as to where to look for or what regions of code to
supply.

Looking for hints as to what is going wrong I went through some of the
OpenSSL functions mentioned above and after "leaving my code" and entering
OpenSSL code the only thing being passed around the functions is the actual
SSL object - and no buffers of any kind. So I suppose the source of the
problem lies in setting up the object, it's context or what ever is stuck to
it.

The first thing I checked on was how the SSL connections are torn down in my
application:
ERR_remove_state(0);
SSL_CTX_free(ssl->ctx);
SSL_free(ssl);
The first line was added only after starting the search for the leaks and
I'm still not sure if that line doesn't break anything.

I did find some minor leaks in my code along the way (e.g. a forgotten
ASN1_INTEGER_free()) but they were neither easy to find - because Valgrind
also reported them like the above two blocks, meaning in the wrong place! -
nor did they change much.

Does anyone have some tips for me ?

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Memory issues with ssl handshake

2012-09-13 Thread Michel

Hi Thomas,

I don't know if it makes a real difference concerning memory leaks,
but I would have freed the TLS session *BEFORE* freing the context :
   SSL_free(ssl);
   ...
   SSL_CTX_free(ssl->ctx);
Does your app setup and free a context each time a client is connecting ?

Le 12/09/2012 16:58, Thomas Eckert a écrit :

Hi,

Valgrind gives me a *lot* of messages like this

==19021== 2,056 bytes in 2 blocks are indirectly lost in loss record 
186 of 190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73BB2: BN_set_bit (bn_lib.c:730)
==19021==by 0x6C7E16E: BN_MONT_CTX_set (bn_mont.c:514)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

Compared to the above they vary only in one line, e.g.

==19021== 1,024 bytes in 2 blocks are indirectly lost in loss record 
181 of 190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73D53: BN_copy (bn_lib.c:506)
==19021==by 0x6C7DFCA: BN_MONT_CTX_set (bn_mont.c:421)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

The application in question is a http proxy and is leaking memory 
heavily. Actually, Valgrind also reports many entries as "still 
reachable" instead of "indirectly lost" but even those regions are 
mentioned by Valgrind like the above two blocks.


I doubt OpenSSL has such blatant memory leaks but I have been 
searching for the leaks for some time now and just cannot find 
anything - also due to the fact that Valgrind reports all the leaks 
like above, which is not really helpful. I do realize that for 
detailed help I would need to give some code on how the connections 
are set up but that code is pretty large. So best would be some hint 
as to where to look for or what regions of code to supply.


Looking for hints as to what is going wrong I went through some of the 
OpenSSL functions mentioned above and after "leaving my code" and 
entering OpenSSL code the only thing being passed around the functions 
is the actual SSL object - and no buffers of any kind. So I suppose 
the source of the problem lies in setting up the object, it's context 
or what ever is stuck to it.


The first thing I checked on was how the SSL connections are torn down 
in my application:

   ERR_remove_state(0);
   SSL_CTX_free(ssl->ctx);
   SSL_free(ssl);
The first line was added only after starting the search for the leaks 
and I'm still not sure if that line doesn't break anything.


I did find some minor leaks in my code along the way (e.g. a forgotten 
ASN1_INTEGER_free()) but they were neither easy to find - because 
Valgrind also reported them like the above two blocks, meaning in the 
wrong place! - nor did they change much.


Does anyone have some tips for me ?
__
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org




__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Memory issues with ssl handshake

2012-09-13 Thread Michel

Hi again Thomas,

Do you really need to free your context each time you free your TLS 
session ?

I believe it is not needed and at least not usual.
If you need several *DIFFERENT* contexts, implying different TLS 
configurations/setup, wich, I think, is not so common,
you can keep them 'alive' during all your app 'run', even in 
multi-threaded programs.
It would allow you to access some activity informations like the ones 
documented in :

http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html

Hope this helps,
Regards

Le 13/09/2012 10:39, Thomas a écrit :

Hi Michel,

Thanks for trying to help, I really appreciate it :-)

"Does your app setup and free a context each time a client is 
connecting ?"


The context is created only when a client requests a HTTPS connection 
and is destroyed together with the SSL session once the connection 
goes down. It is rather related to connections then to clients since 
one client can open several connections but I think you implied one 
connection per client and then the answer is 'yes'.


I will try freeing the session before the context and come back with 
the results.


Regards,
 Thomas



__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Memory issues with ssl handshake

2012-09-13 Thread Thomas

Hi Michel,

Thanks for trying to help, I really appreciate it :-)

"Does your app setup and free a context each time a client is connecting ?"

The context is created only when a client requests a HTTPS connection 
and is destroyed together with the SSL session once the connection goes 
down. It is rather related to connections then to clients since one 
client can open several connections but I think you implied one 
connection per client and then the answer is 'yes'.


I will try freeing the session before the context and come back with the 
results.


Regards,
 Thomas


On 09/13/2012 10:09 AM, Michel wrote:

Hi Thomas,

I don't know if it makes a real difference concerning memory leaks,
but I would have freed the TLS session *BEFORE* freing the context :
   SSL_free(ssl);
   ...
   SSL_CTX_free(ssl->ctx);
Does your app setup and free a context each time a client is connecting ?

Le 12/09/2012 16:58, Thomas a écrit :

Hi,

Valgrind gives me a *lot* of messages like this

==19021== 2,056 bytes in 2 blocks are indirectly lost in loss record 
186 of 190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73BB2: BN_set_bit (bn_lib.c:730)
==19021==by 0x6C7E16E: BN_MONT_CTX_set (bn_mont.c:514)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

Compared to the above they vary only in one line, e.g.

==19021== 1,024 bytes in 2 blocks are indirectly lost in loss record 
181 of 190
==19021==at 0x68EAC8B: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==19021==by 0x6C472DB: default_malloc_ex (mem.c:79)
==19021==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==19021==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==19021==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==19021==by 0x6C73D53: BN_copy (bn_lib.c:506)
==19021==by 0x6C7DFCA: BN_MONT_CTX_set (bn_mont.c:421)
==19021==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==19021==by 0x6C97053: RSA_eay_public_decrypt (rsa_eay.c:693)
==19021==by 0x6C97F1F: RSA_public_decrypt (rsa_lib.c:309)
==19021==by 0x6C98BEB: int_rsa_verify (rsa_sign.c:182)
==19021==by 0x6C98F57: RSA_verify (rsa_sign.c:284)
==19021==by 0x6949E16: ssl3_get_key_exchange (s3_clnt.c:1562)
==19021==by 0x694BF5F: ssl3_connect (s3_clnt.c:335)
==19021==by 0x6964AB9: SSL_connect (ssl_lib.c:933)
==19021==by 0x6953FDD: ssl23_connect (s23_clnt.c:693)
==19021==by 0x6963FBC: SSL_do_handshake (ssl_lib.c:2368)
==19021==by 0x8060D14: ssl_connect (ssl.c:1078)

The application in question is a http proxy and is leaking memory 
heavily. Actually, Valgrind also reports many entries as "still 
reachable" instead of "indirectly lost" but even those regions are 
mentioned by Valgrind like the above two blocks.


I doubt OpenSSL has such blatant memory leaks but I have been 
searching for the leaks for some time now and just cannot find 
anything - also due to the fact that Valgrind reports all the leaks 
like above, which is not really helpful. I do realize that for 
detailed help I would need to give some code on how the connections 
are set up but that code is pretty large. So best would be some hint 
as to where to look for or what regions of code to supply.


Looking for hints as to what is going wrong I went through some of 
the OpenSSL functions mentioned above and after "leaving my code" and 
entering OpenSSL code the only thing being passed around the 
functions is the actual SSL object - and no buffers of any kind. So I 
suppose the source of the problem lies in setting up the object, it's 
context or what ever is stuck to it.


The first thing I checked on was how the SSL connections are torn 
down in my application:

   ERR_remove_state(0);
   SSL_CTX_free(ssl->ctx);
   SSL_free(ssl);
The first line was added only after starting the search for the leaks 
and I'm still not sure if that line doesn't break anything.


I did find some minor leaks in my code along the way (e.g. a 
forgotten ASN1_INTEGER_free()) but they were neither easy to find - 
because Valgrind also reported them like the above two blocks, 
meaning in the wrong place! - nor did they chan

Re: Memory issues with ssl handshake

2012-09-13 Thread Dominik Oepen
On 12.09.2012 16:58, Thomas Eckert wrote:
> Hi,
> 
> Valgrind gives me a *lot* of messages like this
[snip]
> Does anyone have some tips for me ?

Have you seen the FAQ entry regarding valgrind:
http://www.openssl.org/support/faq.html#PROG14 ?

Regards,
Dominik
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Memory issues with ssl handshake

2012-09-18 Thread Thomas

Hi again,

I've changed the code to reuse the SSL contexts but in terms of memory 
consumption/release it did not change much - if anything at all. By the 
way, is there a way to "unload" a certificate once it has been loaded 
into a SSL context via SSL_CTX_use_certificate() ? I didn't find 
anything in the docs and simply specifying NULL as cert parameter caused 
a crash in OpenSSL.


The only places left that cause memory leaks are reported inside OpenSSL 
as in


at 0x68EAC8B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==27041==by 0x6C472DB: default_malloc_ex (mem.c:79)
==27041==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==27041==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==27041==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==27041==by 0x6C73BB2: BN_set_bit (bn_lib.c:730)
==27041==by 0x6C7E16E: BN_MONT_CTX_set (bn_mont.c:514)
==27041==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==27041==by 0x6C95B56: RSA_eay_mod_exp (rsa_eay.c:782)
==27041==by 0x6C96422: RSA_eay_private_decrypt (rsa_eay.c:565)
==27041==by 0x6C97EDF: RSA_private_decrypt (rsa_lib.c:303)
==27041==by 0x6942918: ssl3_get_client_key_exchange (s3_srvr.c:2038)
==27041==by 0x6946693: ssl3_accept (s3_srvr.c:529)
==27041==by 0x69513CA: ssl3_read_bytes (s3_pkt.c:941)
==27041==by 0x694C688: ssl3_read_internal (s3_lib.c:3274)
==27041==by 0x69642E8: SSL_read (ssl_lib.c:954)

Sometimes these are flagged "still reachable" and sometimes "indirectly 
lost", usually both types are reported as I get a large amount of these 
traces. One thing I noticed is that all goes well if I cause the code to 
run sequentially (e.g. cause requests to come one ater another). Yet it 
starts eating up memory like crazy if I cause several (HTTPS) requests 
to come at once.


I'm at a loss here. Valgrind insists the leaks happen in OpenSSL code. 
I'll be happy to supply more information if anyone has an idea of how to 
approach this.


Regards,
 Thomas

On 09/13/2012 12:30 PM, Michel wrote:

Hi again Thomas,

Do you really need to free your context each time you free your TLS 
session ?

I believe it is not needed and at least not usual.
If you need several *DIFFERENT* contexts, implying different TLS 
configurations/setup, wich, I think, is not so common,
you can keep them 'alive' during all your app 'run', even in 
multi-threaded programs.
It would allow you to access some activity informations like the ones 
documented in :

http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html

Hope this helps,
Regards

Le 13/09/2012 10:39, Thomas a écrit :

Hi Michel,

Thanks for trying to help, I really appreciate it :-)

"Does your app setup and free a context each time a client is 
connecting ?"


The context is created only when a client requests a HTTPS connection 
and is destroyed together with the SSL session once the connection 
goes down. It is rather related to connections then to clients since 
one client can open several connections but I think you implied one 
connection per client and then the answer is 'yes'.


I will try freeing the session before the context and come back with 
the results.


Regards,
 Thomas




__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


RE: Memory issues with ssl handshake

2012-09-19 Thread Charles Mills
Try plugging your code to exit after the first OpenSSL function, then after
the second, and so forth, and see if you can get down to the simplest case.

Charles

-Original Message-
From: owner-openssl-us...@openssl.org
[mailto:owner-openssl-us...@openssl.org] On Behalf Of Thomas
Sent: Monday, September 17, 2012 11:36 AM
To: Michel
Cc: openssl-users@openssl.org
Subject: Re: Memory issues with ssl handshake

Hi again,

I've changed the code to reuse the SSL contexts but in terms of memory
consumption/release it did not change much - if anything at all. By the way,
is there a way to "unload" a certificate once it has been loaded into a SSL
context via SSL_CTX_use_certificate() ? I didn't find anything in the docs
and simply specifying NULL as cert parameter caused a crash in OpenSSL.

The only places left that cause memory leaks are reported inside OpenSSL as
in

at 0x68EAC8B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==27041==by 0x6C472DB: default_malloc_ex (mem.c:79)
==27041==by 0x6C4795F: CRYPTO_malloc (mem.c:306)
==27041==by 0x6C73940: bn_expand_internal (bn_lib.c:336)
==27041==by 0x6C73AE0: bn_expand2 (bn_lib.c:451)
==27041==by 0x6C73BB2: BN_set_bit (bn_lib.c:730)
==27041==by 0x6C7E16E: BN_MONT_CTX_set (bn_mont.c:514)
==27041==by 0x6C7E402: BN_MONT_CTX_set_locked (bn_mont.c:552)
==27041==by 0x6C95B56: RSA_eay_mod_exp (rsa_eay.c:782)
==27041==by 0x6C96422: RSA_eay_private_decrypt (rsa_eay.c:565)
==27041==by 0x6C97EDF: RSA_private_decrypt (rsa_lib.c:303)
==27041==by 0x6942918: ssl3_get_client_key_exchange (s3_srvr.c:2038)
==27041==by 0x6946693: ssl3_accept (s3_srvr.c:529)
==27041==by 0x69513CA: ssl3_read_bytes (s3_pkt.c:941)
==27041==by 0x694C688: ssl3_read_internal (s3_lib.c:3274)
==27041==by 0x69642E8: SSL_read (ssl_lib.c:954)

Sometimes these are flagged "still reachable" and sometimes "indirectly
lost", usually both types are reported as I get a large amount of these
traces. One thing I noticed is that all goes well if I cause the code to run
sequentially (e.g. cause requests to come one ater another). Yet it starts
eating up memory like crazy if I cause several (HTTPS) requests to come at
once.

I'm at a loss here. Valgrind insists the leaks happen in OpenSSL code. 
I'll be happy to supply more information if anyone has an idea of how to
approach this.

Regards,
  Thomas

On 09/13/2012 12:30 PM, Michel wrote:
> Hi again Thomas,
>
> Do you really need to free your context each time you free your TLS 
> session ?
> I believe it is not needed and at least not usual.
> If you need several *DIFFERENT* contexts, implying different TLS 
> configurations/setup, wich, I think, is not so common, you can keep 
> them 'alive' during all your app 'run', even in multi-threaded 
> programs.
> It would allow you to access some activity informations like the ones 
> documented in :
> http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html
>
> Hope this helps,
> Regards
>
> Le 13/09/2012 10:39, Thomas a écrit :
>> Hi Michel,
>>
>> Thanks for trying to help, I really appreciate it :-)
>>
>> "Does your app setup and free a context each time a client is 
>> connecting ?"
>>
>> The context is created only when a client requests a HTTPS connection 
>> and is destroyed together with the SSL session once the connection 
>> goes down. It is rather related to connections then to clients since 
>> one client can open several connections but I think you implied one 
>> connection per client and then the answer is 'yes'.
>>
>> I will try freeing the session before the context and come back with 
>> the results.
>>
>> Regards,
>>  Thomas
>>
>
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Query regarding SSL_ERROR_SSL during SSL handshake

2020-02-18 Thread Mahendra SP
Hi All,

We are using Openssl version 1.0.2h. When we call SSL_do_handshake,
sometimes we notice that handshake fails with error SSL_ERROR_SSL.
As per the documentation for this error, it is non recoverable and fatal
error.  Documentation also mentions to check the error queue for further
details. Does it mean, calling SSL_get_error after SSL_ERROR_SSL will give
exact reason for this failure?

Could you please let me know ways to identify the cause of this error?

Thanks
Mahendra


Re: SSL handshake failed - 14090086 and 14095412

2007-02-28 Thread Julius Davies

If you wouldn't mind moving over to "not-yet-common-ssl" mailing list
(SSL and Java) I might be able to help you over there:

http://lists.juliusdavies.ca/listinfo.cgi/not-yet-commons-ssl-juliusdavies.ca/

To me it looks like you are missing a client certificate.

Try using "java -jar not-yet-commons-ssl-0.3.7.jar" to further
troubleshoot this.  You can download it here:

http://juliusdavies.ca/commons-ssl/download.html

Explanation here:

"Ping Utility"
http://juliusdavies.ca/commons-ssl/utilities.html




--
yours,

Julius Davies
416-652-0183
http://juliusdavies.ca/
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


How to use token for ssl handshake

2008-01-07 Thread Fred
Hi,

I'm developping an application which use an ssl tunnel to send some datas.
Everything is ok, while my certificate and associated private key are stored
locally on my hard drive.
But i don't understand how to use use a smartcard for ssl handshake.
 i'm using opensc engine_pkcs11 to communicate with my token.
SSL Engine setup seems to be ok, because i can show objects on my token.
But i don't understand how to configure my SSL_CTX to use certificate and
private key stored on my token ?
What i've missed  ? It seems to be possible 

regards,
Fred


Re: How to dump SSL Handshake messages?

2008-01-11 Thread G.W. Haywood
Hi there,

On Fri, 11 Jan 2008, Vicky Ven wrote:

> I need to the capture the SSL handshake messages between my client
> application and server.
> How do we dump detailed SSL Handshake messages? Does OpenSSL offer some
> means?

Depends on your platform.

Try tcpdump if you have something that offers it - almost all Unix-like
systems do.  Wireshark is very much better but takes a little effort to
install if you don't already have it.

--

73,
Ged.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: How to dump SSL Handshake messages?

2008-01-11 Thread Vicky Ven
Hi,

 I have used ssldump tool. However I need to implement the logging
 capability in my application. For example, if  the application recieves a
particular Alert message , the application should dump all the messages that
were exchanged for that particular handshake.


Thanks,
Vicky



On 1/11/08, Vicky Ven <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I need to the capture the SSL handshake messages between my client
> application and server.
> How do we dump detailed SSL Handshake messages? Does OpenSSL offer some
> means?
>
> Thanks,
> Vicky
>
>


Re: How to dump SSL Handshake messages?

2008-01-11 Thread Marek . Marcola
Hello, 
>  I have used ssldump tool. However I need to implement the logging 
capability in my 
> application. For example, if  the application recieves a particular 
Alert message , the 
> application should dump all the messages that were exchanged for that 
particular handshake. 
You may set message peek callback with SSL_set_msg_callback() function.
Look at examples in apps/ directory.

Best regards,
--
Marek Marcola <[EMAIL PROTECTED]>

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Can't free BIO after ssl handshake fails

2008-05-16 Thread Roman Aspetsberger

Hello.

I have got a big problem in my application:

My application is connecting webservers over ssl. Therefore, I use a bio 
chain bufferBIO -> sslBIO -> socketBIO. I use certificate verification, 
but when a cert verification fails, I have a problem with freeing the 
ssl BIO.
My thread is hanging at BIO_free(serverTlsBIO) with full CPU load. But 
if I don't free the ssl BIO, I have a big memory leak. The interesting 
thing is, that this doesen't happen always, but always with the same 
websites/certificates.


if (BIO_do_handshake(serverTlsBIO) <= 0)
{
BIO_pop(serverTlsBIO);
BIO_free(serverTlsBIO);
return TLS_SERVER_HANDSHAKE_ERR;
}

Has anyone a solution or is anything wrong in my consideration?

Thanks in advance,
Roman

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


problems with BIO pairs and SSL handshake

2008-05-22 Thread Vladimir Sabanov
Hi!

I have some server and async. transport on WINSOCK. Send and receive do with 
next
operations:

DWORD CSSLTLSLayer::Receive(IN OVERLAPPED *pOverlapped,
IN WSABUF *pBuffer, 
OUT PDWORD pdwWasRecv)
{
DWORD dwRet = __super::Receive(pOverlapped, pBuffer, pdwWasRecv);

BIO_write(m_pNetworkBIO, pBuffer->buf, *pdwWasRecv);
BIO_flush(m_pNetworkBIO);

size_t iBuffered = BIO_ctrl_pending(m_pSSLBIO);

if (iBuffered <= 0){
return(WSA_IO_PENDING);
}

m_vcLayeredBuffer.clear();
m_vcLayeredBuffer.resize(iBuffered);
iBuffered = BIO_read(m_pSSLBIO, &m_vcLayeredBuffer.front(), 
(int)iBuffered);

pBuffer->buf = &m_vcLayeredBuffer.front();
pBuffer->len = (u_long)m_vcLayeredBuffer.size();

return(dwRet);
}

DWORD CSSLTLSLayer::Send(IN OVERLAPPED *pOverlapped, 
 IN WSABUF *pBuffer, 
 OUT PDWORD pdwWasSend)
{
size_t iBuffered = BIO_write(m_pSSLBIO, pBuffer->buf, pBuffer->len);

BIO_flush(m_pSSLBIO);
iBuffered = (int)BIO_ctrl_pending(m_pNetworkBIO);

if (iBuffered <= 0){
return(WSA_IO_PENDING);
}

m_vcLayeredBuffer.clear();
m_vcLayeredBuffer.resize(iBuffered);

iBuffered = BIO_read(m_pNetworkBIO, 
 &m_vcLayeredBuffer.front(), 
 (int)iBuffered);

pBuffer->buf = &m_vcLayeredBuffer.front();
pBuffer->len = (u_long)m_vcLayeredBuffer.size();

return(__super::Send(pOverlapped, pBuffer, pdwWasSend));
}

But i have a problem with handshake. How can i do SSL handshake using
BIO and without SSL_accept or SSL_set_accept_state()+SSL_do_handshake.

Thanks for support!;)

--
Best regards, 
Vladimir Sabanov mailto:[EMAIL PROTECTED]
Software Developer of ApriorIT - A PriorITy choice!

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


ssl handshake failure (was Re: 386 problems)

1999-04-28 Thread Philip


Ulf,

I removed the cpp file and everything finally compiled without errors.
Thanks for your continued assistance on this!

Unfortunately, I'm still not able to connect and am still at a loss
as to why.  When I run s_client I receive the following:

CONNECTED(0003)
31019:error:140790E3:SSL routines:SSL23_WRITE:ssl handshake
failure:s23_lib.c:224:

I have a client.pem in /usr/local/ssl/certs and even specified that
as an option to s_client.  When I try running apps on top
of openssl (e.g. - lxp, eassl and Net::SSLeay) they dump core.

Anybody have any idea why this is happening?  I basically just want
to use ssleay as a lynx client.  Never thought it would be this difficult.

Regards,

Philip


Ulf Möller wrote:

> The CVS contained an assembler file that should not have been there.
> Please remove crypto/bf/asm/bx86unix.cpp and run "make" again.

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: bad mac decode in ssl handshake

2000-09-25 Thread Tim Tassonis

Hi Arun


On Fri, 22 Sep 2000, Arun Venkataraman wrote:
> 
> Looks like the webserver handles SSLv3 properly but not SSLv23 (why?). I
> tried:
> "openSsl> s_client -debug -sslv3 -connect www.genowebpayment.de:443" and
> it
> worked fine.

You're right, I managed to connect like this as well. The Web Server used
is by the way IBM HTTP Server 1.3.6.2, so probably quite widely used.

What I found out as well:

- openssl s_client -ssl2 works
- openssl s_client -ssl3 works

So, only when I specify no protocol, the error occurs. What could that
mean?

Bye
Tim


> 
> Arun.
> 
> - Original Message -
> From: "Tim Tassonis" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, September 22, 2000 9:17 AM
> Subject: bad mac decode in ssl handshake
> 
> 
> > Hi
> >
> > When I try to contact the following SSL site with s_client, I cannot
> > connect:
> >
> > www.genowebpayment.de:443
> >
> > I haven't got an idea what web server they're using, but I can connect
> > successfully with Netscape Communicator 4.75 under Linux for instance.
> >
> > The error occurs under 0.95a and 0.9.6-beta3 at least.
> >
> > This is the command I set up:
> >
> > openssl s_client -debug -connect www.genowebpayment.de:443
> >
> > And this is the output (after the verify) I get:
> >
> > verify return:0
> > read from 0814B978 [08150F20] (5 bytes => 5 (0x5))
> >  - 16 03 00 00 04.
> > read from 0814B978 [08150F25] (4 bytes => 4 (0x4))
> >  - 0e.
> > 0004 - 
> > write to 0814B978 [0815A370] (137 bytes => 137 (0x89))
> >  - 16 03 00 00 84 10 00 00-80 3f c3 0e 89 e0 fc 15  
> .?..
> > 0010 - c6 40 24 98 b6 f0 8a f0-2f f5 38 da f0 0e 3d 99  
> .@$./.8...=.
> > 0020 - ec d9 a7 b0 35 79 92 07-07 ad 3c 1d 1e 3f 0f a0  
> 5y<..?..
> > 0030 - 08 59 e4 f9 98 2f 58 10-9d 51 4a af ea 70 f3 64  
> .Y.../X..QJ..p.d
> > 0040 - 40 44 3c dd 1d ce 76 41-f7 35 60 5f f3 38 03 75  
> @D<...vA.5`_.8.u
> > 0050 - 6b 03 22 4f 8e 2f c1 41-09 cd be 3a e5 82 d2 a3  
> k."O./.A...:
> > 0060 - 69 ae 4b 1b 99 ad 09 39-4b dd 82 e2 95 b8 eb 15  
> i.K9K...
> > 0070 - 9c 9d f5 e4 f6 f2 ab 3b-08 25 5a 69 7f 5b 58 ab  
> ...;.%Zi.[X.
> > 0080 - 55 b4 0a b8 00 c7 9a f4-7aU...z
> > write to 0814B978 [0815A370] (6 bytes => 6 (0x6))
> >  - 14 03 00 00 01 01 ..
> > write to 0814B978 [0815A370] (61 bytes => 61 (0x3D))
> >  - 16 03 00 00 38 06 d3 88-fe e8 e0 2e e7 d4 fb 37  
> 8..7
> > 0010 - ca e2 ec d3 4c 3d 8d 78-0b 0f 02 c5 4e 2e 22 4d  
> L=.xN."M
> > 0020 - 29 e0 e8 33 bc a8 f7 40-c6 7d a6 00 f2 cc 0b 5b  
> )..3...@.}.[
> > 0030 - 7d 9f 99 05 c8 47 17 a6-9a a8 20 dc 9e}G ..
> > read from 0814B978 [08150F20] (5 bytes => 5 (0x5))
> >  - 14 03 00 00 01.
> > read from 0814B978 [08150F25] (1 bytes => 1 (0x1))
> >  - 01.
> > read from 0814B978 [08150F20] (5 bytes => 5 (0x5))
> >  - 15 03 00 00 12.
> > read from 0814B978 [08150F25] (18 bytes => 18 (0x12))
> >  - 76 4e 6e 26 cc b7 62 08-69 a5 61 f1 b1 05 3e d1  
> vNn&..b.i.a...>.
> > 0010 - c3 4d .M
> > write to 0814B978 [0815A370] (23 bytes => 23 (0x17))
> >  - 15 03 00 00 12 80 33 d5-37 ca 49 35 81 53 72 b5  
> ..3.7.I5.Sr.
> > 0010 - a7 f9 0b f7 b8 79 72  .yr
> > 11479:error:1408F071:SSL routines:SSL3_GET_RECORD:bad mac
> > decode:s3_pkt.c:383:
> >
> > Any ideas, anybody
> >
> > Thanks
> > Tim
> >
> >
> >
> > __
> > OpenSSL Project http://www.openssl.org
> > Development Mailing List   [EMAIL PROTECTED]
> > Automated List Manager   [EMAIL PROTECTED]
> >
> 
> __
> OpenSSL Project http://www.openssl.org
> User Support Mailing List[EMAIL PROTECTED]
> Automated List Manager   [EMAIL PROTECTED]
> 
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: bad mac decode in ssl handshake

2000-09-25 Thread Richard Levitte - VMS Whacker

From: Tim Tassonis <[EMAIL PROTECTED]>

timtas> What I found out as well:
timtas> 
timtas> - openssl s_client -ssl2 works
timtas> - openssl s_client -ssl3 works
timtas> 
timtas> So, only when I specify no protocol, the error occurs. What could that
timtas> mean?

That the server doesn't like TLS1 too much, I guess, or that there is
something weird when TLS1 is used.  Trying the following makes it
pretty clear:

  openssl s_client -debug -no_tls1 -connect www.genowebpayment.de:443

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
Redakteur@Stacken   \  SWEDEN   \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis-- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/

Unsolicited commercial email is subject to an archival fee of $400.
See  for more info.
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: bad mac decode in ssl handshake

2000-09-25 Thread Michael Lee

Tim Tassonis wrote:

> www.genowebpayment.de:443
>
> I haven't got an idea what web server they're using, but I can connect
> successfully with Netscape Communicator 4.75 under Linux for instance.

You can find out what server a SSL-enabled web site is running at Netcraft:

http://www.netcraft.com/sslwhats/

According to Netcraft, the site you mentioned is running this:

IBM_HTTP_Server/1.3.6.2 Apache/1.3.7-dev (Unix)


Regards,
Michael Lee

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: Non-Blocking Sockets for SSL HandShake?

2003-03-24 Thread Tim Regovich
If your sockets are all in non-blocking mode, you will
need to do a select() on the socket (for writing)
after the call to connect() to confirm that the
connection has completed.  The SSL_connect() call
should then return the need_write/need_read.  If it
doesn't, then I would try looping even if you get the
ERR_SYSCALL error, wrap the whole thing in a 2 second
alert, and do some testing to make sure that 2 seconds
is a good number as a max wait time.
  
My concern is that the underlying sockets are not
fully compliant, and so the openssl code is reporting
the best error that it can.

Tim

--- rajagopalan ramanujam <[EMAIL PROTECTED]>
wrote:
> hi tim,
> 
> I forgot to mention about the version, its
> openssl-0.9.7 and the OS is threadX running on ARM
> processor using GH compiler.
> 
> raj
> 
> --- Tim Regovich <[EMAIL PROTECTED]> wrote:
> > did youtry ERR_get_error() or perror("") to see
> what
> > they return.
> > 
> > The only guess i have is that the underlying
> socket
> > is
> > not yet connected, but i would have expectedan
> > SSL_ERROR_WANT_ACCEPT.
> > 
> > Are you using SSL_set_fd(...)?
> > 
> > Can you send me the conect section of your code? 
> I
> > will take a look at it and see what is going on.
> > 
> > also helpful would be what OS you are running on
> and
> > what version of openssl.
> > 
> > You can email me directly [EMAIL PROTECTED] and
> we
> > can take this off the discussion board.
> > 
> > Regards,
> > 
> > Tim
> > --- rajagopalan ramanujam
> <[EMAIL PROTECTED]>
> > wrote:
> > > 
> > > SSL_connect(ssl) return 0 and
> > SSL_get_error(ssl,err)
> > > is returning SSL_ERROR_SYSCALL.What i am i doing
> > > wrong?
> > > 
> > > 
> > > while(!done) {
> > >  err = SSL_connect(ssl);
> > >  if(err >0 || (SSL_get_error(ssl,err) != 
> > > SSL_ERROR_WANT_READ && SSL_get_error(ssl,err) !=
> > > SSL_ERROR_WANT_WRITE))
> > >done = 1;
> > >   }
> > > Its taking arround 10 secs to respond to the
> > > ClientHello message from the openssl s_server
> > > running
> > > on linux.
> > > 
> > > If i introduce a delay then things work fine.
> > > 
> > > 
> > > 
> > > 
> > > --- Tim Regovich <[EMAIL PROTECTED]> wrote:
> > > > Ignore my last message, it was incomplete.
> > > > you should not need to use a bio pair.
> > > > Instead, you should be able to do something
> like
> > > so
> > > > :
> > > > 
> > > > while(!done) {
> > > >   rv = SSL_connect(my_ssl_ptr);
> > > >   if(rv >=0 || (SSL_get_error() !=
> > > > SSL_ERROR_WANT_READ
> > > >   && SSL_Get_error() !=
> SSL_WANT_WRITE)
> > > >  done = 1;
> > > > }
> > > > 
> > > > This will lock your system up for the length
> of
> > > the
> > > > transaction though, which could be
> problematic. 
> > > For
> > > > robustness you would then want to wrap this
> code
> > > in
> > > > an
> > > > alert or some other notifying mechanism to
> allow
> > > for
> > > > a
> > > > hard timeout.
> > > > 
> > > > Regards,
> > > > 
> > > > Tim
> > > > 
> > > > --- rajagopalan ramanujam
> > > <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > hi tim,
> > > > > 
> > > > > Thanks for the response. The first solution
> > that
> > > > you
> > > > > proposed, is it that SSL_connect calling
> again
> > > > based
> > > > > on the return value (like
> > > > SSL_ERROR_WANT_READ.Should
> > > > > i
> > > > > use a BIO pair?
> > > > > 
> > > > > Socket layer was implemented locally and was
> > > > > Blocking
> > > > > functionality was disabled intentionaly (God
> > > knows
> > > > > why)
> > > > > 
> > > > > - raj
> > > > > 
> > > > > --- Tim Regovich <[EMAIL PROTECTED]>
> wrote:
> > > > > > There are two solutions :
> > > > > > 
> > > > > > 1) rewrite the client to use a non
> blocking
> > io
> > > > > model
> > > > > > and handle the incoming dtat
> asynchronously
> > > > > > 
> > > > > > 2) modify the client to wait at each SSL
> api
> > > > > command
> > > > > > (handshakes, reads, writes) until the
> error
> > > code
> > > > > > return is not WANT_READ or WANT_WRITE. 
> This
> > > of
> > > > > > course
> > > > > > will only work if you are doing reads of a
> > > known
> > > > > > size.
> > > > > > 
> > > > > > What embedded board are you using that
> > doesn't
> > > > > > support
> > > > > > synchronous socket I/O?
> > > > > > 
> > > > > > Regards,
> > > > > > 
> > > > > > Tim
> > > > > > 
> > > > > > 
> > > > > > --- rajagopalan ramanujam
> > > > > <[EMAIL PROTECTED]>
> > > > > > wrote:
> > > > > > > hi,
> > > > > > > 
> > > > > > > I am running client on the embedded
> board
> > > > which
> > > > > > has
> > > > > > > TCP stack with only non-blocking sockets
> > > > > > support.The
> > > > > > > problem is that when i send clientHello
> > > > message
> > > > > to
> > > > > > > the
> > > > > > > server (running linux) responds with
> > > > serverhello
> > > > > > > only
> > > > > > > after 2 Secs and since the sockets on my
> > > side
> > > > is
> > > > > > > always non-blocking when it tries to
> read
> > > > > > > (ret=ssl3_get_server_hello(s)) always
> > return
> > > 

Openssl-0.9.7c changes cause SSL handshake failure

2003-10-20 Thread Tal Mozes
Title: Openssl-0.9.7c changes cause SSL handshake failure






Hi all,

I need some help in figuring out how to solve a SSL handshake failure that started after upgrading (from 0.9.7b) to 0.9.7c. Here are the symptoms:

SSL_connect breaks with SSL_R_MISSING_EXPORT_TMP_RSA_KEY. This happens because the client plans on using RSA_EXPORT1024_WITH_DES_CBC_SHA, and the server has a certificate with a 1024-bit RSA key. 

In 0.9.7b there was a bug in X509_certificate_type() that caused it to mark the server's public key with EVP_PKT_EXP (i.e. this is an export cipher key). The bug was fixed in 0.9.7c, and so I have an EXPORT cipher, with NON-EXPORT key.

This causes a check in ssl3_check_cert_and_algorithm() to fail because an EXPORT algorithm is used with NON-EXPORT certificate, and no temporary EXPORT key.

My question is: Why is this check needed? Is it required in SSL/TLS specification? It seems strange to me to blame the server for not generating a temporary 512 bit key (the algorithm specifies explicitly RSA-1024…). 

Anybody encountered this before? Any solution / workaround?

I'm using Windows2000 as the server, and my application which is linked with OpenLDAP and OpenSSL as the client.

Thanks

    Tal





RE: Getting detailed ssl-handshake debug output

2010-10-08 Thread Dave Thompson
> From: owner-openssl-us...@openssl.org On Behalf Of Jeff Saremi
> Sent: Thursday, 07 October, 2010 15:15

>  I'd like to know if there's a way -- programmatic, config, 
> environment
> -- that I can get detailed print of what goes on during a handshake at
> the client or the server? Below is the output from Apache Tomcat as an
> example of the level of details i'm looking for:
> 
Not in OpenSSL, I'm pretty sure.

If you can install other software on the same machine, 
or (usually?) another machine on the same LAN, WireShark from 
www.wireshark.org can display it on screen, or save a trace file 
which you can open and re-display later. I haven't found a way to 
capture the formatted display (except screen print on Windows).

This will only work for initial negotiation, since renegotiation 
is encrypted (unless the initial/current ciphersuite is eNULL). 
ssldump might work in that case, but I haven't tried it.



__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


RE: Getting detailed ssl-handshake debug output

2010-10-11 Thread Jeff Saremi
 I received the answer in a direct email and just wanted to share it
here too:

- command line:

openssl s_client -state -debug -connect host:port

- programmatic:

One can look in the callback mechanism used in the above, specifically in 
apps/s_cb.c
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


  1   2   >