Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We've recently set up a new development server and have been experiencing problems when trying to connect to an API via an instance of SoapClient. I think I've narrowed down the issue to being the fact the new server can't establish a connection to a website using the HTTPS protocol.

We have the intermediate certificate bundle on the server.

mod_ssl is enabled
OpenSSL is enabled

When trying to do a wget to a secure connection I'm getting the following error:

[root@x ~]# wget --http-user=xxxxx --http-passwd=xxxxx --no-check-certificate 'https://www.xxx.com/dev/aspapi/api.asmx?wsdl'
--2014-01-23 11:22:26--  https://www.xxx.com/dev/aspapi/api.asmx?wsdl
Resolving www.xxx.com... xxx.xx.xxx.xx
Connecting to www.xxx.com|xxx.xx.xxx.xx|:443... connected.
Unable to establish SSL connection.
[root@x ~]#

When running the same wget from one of our production servers the response is as expected.

What am I missing?

As suggested, please see below for output of s_client:

s_client with -debug option

openssl s_client -debug -connect www.xxx.com:443
CONNECTED(00000003)
write to 0x1fa8690 [0x1fa9ed0] (263 bytes => 263 (0x107))
0000 - 16 03 01 01 02 01 00 00-fe 03 03 52 e1 18 ad 33   ...........R...3
0010 - 3a cb e7 5c 23 4d 06 76-b0 90 78 2b 1f 00 1d 85   :..\#M.v..x+....
0020 - a0 8e b6 98 5a 65 f6 7d-39 cf cb 00 00 94 c0 30   ....Ze.}9......0
0030 - c0 2c c0 28 c0 24 c0 14-c0 0a 00 a3 00 9f 00 6b   .,.(.$.........k
0040 - 00 6a 00 39 00 38 00 88-00 87 c0 32 c0 2e c0 2a   .j.9.8.....2...*
0050 - c0 26 c0 0f c0 05 00 9d-00 3d 00 35 00 84 c0 12   .&.......=.5....
0060 - c0 08 00 16 00 13 c0 0d-c0 03 00 0a c0 2f c0 2b   ............./.+
0070 - c0 27 c0 23 c0 13 c0 09-00 a2 00 9e 00 67 00 40   .'.#.........g.@
0080 - 00 33 00 32 00 9a 00 99-00 45 00 44 c0 31 c0 2d   .3.2.....E.D.1.-
0090 - c0 29 c0 25 c0 0e c0 04-00 9c 00 3c 00 2f 00 96   .).%.......<./..
00a0 - 00 41 00 07 c0 11 c0 07-c0 0c c0 02 00 05 00 04   .A..............
00b0 - 00 15 00 12 00 09 00 14-00 11 00 08 00 06 00 03   ................
00c0 - 00 ff 01 00 00 41 00 0b-00 04 03 00 01 02 00 0a   .....A..........
00d0 - 00 06 00 04 00 18 00 17-00 23 00 00 00 0d 00 22   .........#....."
00e0 - 00 20 06 01 06 02 06 03-05 01 05 02 05 03 04 01   . ..............
00f0 - 04 02 04 03 03 01 03 02-03 03 02 01 02 02 02 03   ................
0100 - 01 01 00 0f 00 01 01                              .......
read from 0x1fa8690 [0x1faf430] (7 bytes => 0 (0x0))
140276217710408:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 263 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE

s_client with -msg option

openssl s_client -msg -connect www.xxx.com:443
CONNECTED(00000003)
>>> TLS 1.2 Handshake [length 0102], ClientHello
    01 00 00 fe 03 03 52 e1 18 ff d4 04 98 40 0f 81
    ae b0 82 63 69 c8 f7 cb 52 18 41 8b 53 0e cd 8c
    ec 6a 7c 39 25 e5 00 00 94 c0 30 c0 2c c0 28 c0
    24 c0 14 c0 0a 00 a3 00 9f 00 6b 00 6a 00 39 00
    38 00 88 00 87 c0 32 c0 2e c0 2a c0 26 c0 0f c0
    05 00 9d 00 3d 00 35 00 84 c0 12 c0 08 00 16 00
    13 c0 0d c0 03 00 0a c0 2f c0 2b c0 27 c0 23 c0
    13 c0 09 00 a2 00 9e 00 67 00 40 00 33 00 32 00
    9a 00 99 00 45 00 44 c0 31 c0 2d c0 29 c0 25 c0
    0e c0 04 00 9c 00 3c 00 2f 00 96 00 41 00 07 c0
    11 c0 07 c0 0c c0 02 00 05 00 04 00 15 00 12 00
    09 00 14 00 11 00 08 00 06 00 03 00 ff 01 00 00
    41 00 0b 00 04 03 00 01 02 00 0a 00 06 00 04 00
    18 00 17 00 23 00 00 00 0d 00 22 00 20 06 01 06
    02 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03
    01 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00
    01 01
140507405506376:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 263 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE

s_client with -state option

openssl s_client -msg -connect www.xxx.com:443
CONNECTED(00000003)
>>> TLS 1.2 Handshake [length 0102], ClientHello
    01 00 00 fe 03 03 52 e1 18 ff d4 04 98 40 0f 81
    ae b0 82 63 69 c8 f7 cb 52 18 41 8b 53 0e cd 8c
    ec 6a 7c 39 25 e5 00 00 94 c0 30 c0 2c c0 28 c0
    24 c0 14 c0 0a 00 a3 00 9f 00 6b 00 6a 00 39 00
    38 00 88 00 87 c0 32 c0 2e c0 2a c0 26 c0 0f c0
    05 00 9d 00 3d 00 35 00 84 c0 12 c0 08 00 16 00
    13 c0 0d c0 03 00 0a c0 2f c0 2b c0 27 c0 23 c0
    13 c0 09 00 a2 00 9e 00 67 00 40 00 33 00 32 00
    9a 00 99 00 45 00 44 c0 31 c0 2d c0 29 c0 25 c0
    0e c0 04 00 9c 00 3c 00 2f 00 96 00 41 00 07 c0
    11 c0 07 c0 0c c0 02 00 05 00 04 00 15 00 12 00
    09 00 14 00 11 00 08 00 06 00 03 00 ff 01 00 00
    41 00 0b 00 04 03 00 01 02 00 0a 00 06 00 04 00
    18 00 17 00 23 00 00 00 0d 00 22 00 20 06 01 06
    02 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03
    01 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00
    01 01
140507405506376:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 263 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
[root@kestrel CA]# openssl s_client -state -connect www.xxx.com:443
CONNECTED(00000003)
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
140674388653896:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 263 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
share|improve this question

2 Answers 2

downgrade your openssl version to the latest 1.0.0

share|improve this answer
1  
Why? Through what logic did you decide this might fix the problem? Also, wrong. –  HopelessN00b Apr 23 at 9:52

You need to get more information (obviously) about why the SSL handshake is failing. wget -v may help, or if not, you could try s_client -connect www.xxx.com:443, with some combination of -state, -msg, or -debug.

share|improve this answer
    
I've put the output from your suggestions into the original post. So there's no peer certificate available, nor were the client certificate CA names sent - that sounds like my issue although I'm not 100% on that. –  Ryan Jan 23 at 13:36
    
Since the peer, in this case, is your server. I'd double check that you have a certificate installed, even if its a self-signed one. –  etherfish Jan 23 at 13:37
    
The server has a self signed certificate - although it's obviously not being picked up. Not sure why that would be. –  Ryan Jan 23 at 13:40
    
I've recreated the self-signed certificate and I'm still receiving the same error. As far as I'm aware the certificate belongs in /etc/pki/tls/certs? The certificate is also named localhost.crt. I feel as though I'm missing something really simple. –  Ryan Jan 23 at 14:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.