# ECC Certificates and SNI

**URL:** <https://www.ruby-forum.com/t/ecc-certificates-and-sni/231531>\
**Category:** NGINX\
**Created:** [August 13, 2014, 9:23pm UTC](https://www.ruby-forum.com/t/ecc-certificates-and-sni/231531 "2014-08-13T21:23:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 13, 2014, 9:23pm UTC](https://www.ruby-forum.com/t/ecc-certificates-and-sni/231531/1 "2014-08-13T21:23:42Z")

</div>

Hi.

today I have setuped a second SSL VHost with ECC.

Why is the default server able to offer TLS 1.2 but the second one not?

/usr/sbin/nginx -c /etc/nginx/nginx.conf -V  
nginx version: nginx/1.7.4  
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)  
TLS SNI support enabled

from [nginx.org](http://nginx.org).

Global ssl-setup:

egrep -v ‘^(#|$)’ /home/nginx/installed/conf/ssl.conf

```
     add_header Strict-Transport-Security "max-age=2628000;

```

includeSubDomains";  
ssl\_protocols TLSv1 TLSv1.1 TLSv1.2;  
ssl\_session\_cache shared:SSL:10M;  
ssl\_session\_timeout 10m;  
ssl\_prefer\_server\_ciphers on;  
ssl\_dhparam /etc/ssl/dh\_2048.pem;  
ssl\_trusted\_certificate  
/home/nginx/installed/conf/ssl\_dir/certs/CACert\_Certs.pem;  
ssl\_stapling on;  
############

The first VHost

listen 443 default\_server ssl spdy;  
listen [::]:443 default\_server ssl spdy;  
server\_name xxxx;

Check on [ssllabs.com](http://ssllabs.com)

##################  
Key EC 384 bits  
Issuer COMODO ECC Domain Validation Secure Server CA  
Signature algorithm SHA256withECDSA  
Extended Validation No  
Revocation information CRL, OCSP  
Revocation status Good (not revoked)  
Trusted Yes

## Protocols

TLS 1.2 Yes  
TLS 1.1 Yes  
TLS 1.0 Yes  
SSL 3 No  
SSL 2 No

Cipher Suites (SSL 3+ suites in server-preferred order; deprecated and  
SSL 2 suites always at the end)  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_GCM\_SHA384 (0xc02c) ECDH 256 bits (eq.  
3072 bits RSA) FS 256  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_GCM\_SHA256 (0xc02b) ECDH 256 bits (eq.  
3072 bits RSA) FS 128  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA384 (0xc024) ECDH 256 bits (eq.  
3072 bits RSA) FS 256  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_CBC\_SHA256 (0xc023) ECDH 256 bits (eq.  
3072 bits RSA) FS 128  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA (0xc00a) ECDH 256 bits (eq. 3072  
bits RSA) FS 256  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_CBC\_SHA (0xc009) ECDH 256 bits (eq. 3072  
bits RSA) FS 128  
#############

The second one  
listen 443 ssl spdy;  
listen [::]:443 ssl spdy;  
server\_name xxx;

############  
Key EC 384 bits  
Issuer COMODO ECC Domain Validation Secure Server CA  
Signature algorithm SHA256withECDSA  
Extended Validation No  
Revocation information CRL, OCSP  
Revocation status Good (not revoked)  
Trusted Yes

## Protocols

TLS 1.2 No  
TLS 1.1 Yes  
TLS 1.0 Yes  
SSL 3 No  
SSL 2 No

Cipher Suites (SSL 3+ suites in server-preferred order; deprecated and  
SSL 2 suites always at the end)  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA (0xc00a) ECDH 256 bits (eq. 3072  
bits RSA) FS 256  
TLS\_ECDHE\_ECDSA\_WITH\_3DES\_EDE\_CBC\_SHA (0xc008) ECDH 256 bits (eq. 3072  
bits RSA) FS 112  
TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_CBC\_SHA (0xc009) ECDH 256 bits (eq. 3072  
bits RSA) FS 128  
#############

Firefox 31.0 on gentoo is not able to connect.  
Chromium Version 37.0.2062.68 (287650) (64-bit) is able to connect but  
also only with TLS 1.1

Any Ideas what’s wrong?

Thanks for help

Best regards  
Aleks

---

<div class="post-metadata">

**Author:** ![Aleksandar\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@Aleksandar\_L](https://www.ruby-forum.com/u/Aleksandar_L)\
**Post date:** [August 13, 2014, 9:32pm UTC](https://www.ruby-forum.com/t/ecc-certificates-and-sni/231531/2 "2014-08-13T21:32:03Z")

</div>

This is the output of the debug log.

######################  
2014/08/13 21:29:46 [debug] 915#0: \*1 SSL certificate status callback  
2014/08/13 21:29:46 [debug] 915#0: \*1 SSL NPN advertised  
2014/08/13 21:29:46 [debug] 915#0: \*1 SSL\_do\_handshake: -1  
2014/08/13 21:29:46 [debug] 915#0: \*1 SSL\_get\_error: 1  
2014/08/13 21:29:46 [crit] 915#0: \*1 SSL\_do\_handshake() failed (SSL:  
error:1409B044:SSL routines:SSL3\_SEND\_SERVER\_KEY\_EXCHANGE:internal  
error) while SSL handshaking, client: \<MY\_CLIENT\>, server: 0.0.0.0:443  
2014/08/13 21:29:46 [debug] 915#0: \*1 close http connection: 81  
2014/08/13 21:29:46 [debug] 915#0: \*1 SSL\_shutdown: 1  
2014/08/13 21:29:46 [debug] 915#0: \*1 event timer del: 81: 1407958246379  
2014/08/13 21:29:46 [debug] 915#0: \*1 reusable connection: 0  
2014/08/13 21:29:46 [debug] 915#0: \*1 free: 0000000000D9CB60, unused: 0  
2014/08/13 21:29:46 [debug] 915#0: \*1 free: 0000000000EBDEC0, unused:  
104  
######################

Am 13-08-2014 21:23, schrieb Aleksandar L.:

---

<div class="post-metadata">

**Author:** ![Aleksandar\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@Aleksandar\_L](https://www.ruby-forum.com/u/Aleksandar_L)\
**Post date:** [August 16, 2014, 11:54am UTC](https://www.ruby-forum.com/t/ecc-certificates-and-sni/231531/3 "2014-08-16T11:54:52Z")

</div>

Hello,

The error comes from OpenSSL.

From its name, I wouldsay the constant being check is one that OpenSSL  
sets  
during handshake.  
From its name too, I wouls say this applies to a SSLv3 handshake.  
OpenSSL  
has a corresponding TLSv1 constant named DTLS1\_SEND\_SERVER\_KEY\_EXCHANGE.  
Seems like a bug, possibly related to the (non widespread) use of ECC  
certificates.

Before really calling out for a bug: you say SSLv3 is disabled. Please  
be  
really sure of that.

Check the OpenSSL library your nginx has been linked against. I suggest  
you  
update that package on your system and retry.  
Try balance between sufficiently up-to-date version and avoinding  
versions  
with well-known vulnerabilities.

## Hope I helped,

_B. R._

---

<div class="post-metadata">

**Author:** ![Aleksandar\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@Aleksandar\_L](https://www.ruby-forum.com/u/Aleksandar_L)\
**Post date:** [August 31, 2014, 5:24pm UTC](https://www.ruby-forum.com/t/ecc-certificates-and-sni/231531/4 "2014-08-31T17:24:34Z")

</div>

Dear B. R.

It looks like this is a firefox isssue.

With chomium 38 and curl and s\_client I was able to connect.

##########  
openssl version -a  
OpenSSL 1.0.1 14 Mar 2012  
built on: Thu Aug 7 13:42:02 UTC 2014  
platform: debian-amd64  
options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx)  
compiler: cc -fPIC -DOPENSSL\_PIC -DZLIB -DOPENSSL\_THREADS -D\_REENTRANT  
-DDSO\_DLFCN -DHAVE\_DLFCN\_H -m64 -DL\_ENDIAN -DTERMIO -g -O2  
-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security  
-Werror=format-security -D\_FORTIFY\_SOURCE=2 -Wl,-Bsymbolic-functions  
-Wl,-z,relro -Wa,–noexecstack -Wall -DOPENSSL\_NO\_TLS1\_2\_CLIENT  
-DOPENSSL\_MAX\_TLS1\_2\_CIPHER\_LENGTH=50 -DMD32\_REG\_T=int  
-DOPENSSL\_IA32\_SSE2 -DOPENSSL\_BN\_ASM\_MONT -DOPENSSL\_BN\_ASM\_MONT5  
-DOPENSSL\_BN\_ASM\_GF2m -DSHA1\_ASM -DSHA256\_ASM -DSHA512\_ASM -DMD5\_ASM  
-DAES\_ASM -DVPAES\_ASM -DBSAES\_ASM -DWHIRLPOOL\_ASM -DGHASH\_ASM

/usr/sbin/nginx -c /etc/nginx/nginx.conf -V  
nginx version: nginx/1.7.4  
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)  
TLS SNI support enabled  
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx  
–conf-path=/etc/nginx/nginx.conf  
–error-log-path=/var/log/nginx/error.log  
–http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid  
–lock-path=/var/run/nginx.lock  
–http-client-body-temp-path=/var/cache/nginx/client\_temp  
–http-proxy-temp-path=/var/cache/nginx/proxy\_temp  
–http-fastcgi-temp-path=/var/cache/nginx/fastcgi\_temp  
–http-uwsgi-temp-path=/var/cache/nginx/uwsgi\_temp  
–http-scgi-temp-path=/var/cache/nginx/scgi\_temp --user=nginx  
–group=nginx --with-http\_ssl\_module --with-http\_realip\_module  
–with-http\_addition\_module --with-http\_sub\_module  
–with-http\_dav\_module --with-http\_flv\_module --with-http\_mp4\_module  
–with-http\_gunzip\_module --with-http\_gzip\_static\_module  
–with-http\_random\_index\_module --with-http\_secure\_link\_module  
–with-http\_stub\_status\_module --with-http\_auth\_request\_module  
–with-mail --with-mail\_ssl\_module --with-file-aio  
–with-http\_spdy\_module --with-cc-opt=‘-g -O2 -fstack-protector  
–param=ssp-buffer-size=4 -Wformat -Wformat-security  
-Wp,-D\_FORTIFY\_SOURCE=2’ --with-ld-opt=‘-Wl,-Bsymbolic-functions  
-Wl,-z,relro -Wl,–as-needed’ --with-ipv6

ldd /usr/sbin/nginx  
linux-vdso.so.1 =\> (0x00007fff54dfe000)  
libpthread.so.0 =\> /lib/x86\_64-linux-gnu/libpthread.so.0  
(0x00007fdac5938000)  
libcrypt.so.1 =\> /lib/x86\_64-linux-gnu/libcrypt.so.1  
(0x00007fdac56ff000)  
libpcre.so.3 =\> /lib/x86\_64-linux-gnu/libpcre.so.3 (0x00007fdac54c1000)  
libssl.so.1.0.0 =\> /lib/x86\_64-linux-gnu/libssl.so.1.0.0  
(0x00007fdac5263000)  
libcrypto.so.1.0.0 =\> /lib/x86\_64-linux-gnu/libcrypto.so.1.0.0  
(0x00007fdac4e88000)  
libz.so.1 =\> /lib/x86\_64-linux-gnu/libz.so.1 (0x00007fdac4c70000)  
libc.so.6 =\> /lib/x86\_64-linux-gnu/libc.so.6 (0x00007fdac48b1000)  
/lib64/ld-linux-x86-64.so.2 (0x00007fdac5b63000)  
libdl.so.2 =\> /lib/x86\_64-linux-gnu/libdl.so.2 (0x00007fdac46ad000)

ldd $(which openssl)  
linux-vdso.so.1 =\> (0x00007fffdddfe000)  
libssl.so.1.0.0 =\> /lib/x86\_64-linux-gnu/libssl.so.1.0.0  
(0x00007fbd557c6000)  
libcrypto.so.1.0.0 =\> /lib/x86\_64-linux-gnu/libcrypto.so.1.0.0  
(0x00007fbd553eb000)  
libc.so.6 =\> /lib/x86\_64-linux-gnu/libc.so.6 (0x00007fbd5502b000)  
libdl.so.2 =\> /lib/x86\_64-linux-gnu/libdl.so.2 (0x00007fbd54e27000)  
libz.so.1 =\> /lib/x86\_64-linux-gnu/libz.so.1 (0x00007fbd54c10000)  
/lib64/ld-linux-x86-64.so.2 (0x00007fbd55a32000)

#########

cheers a l

Am 16-08-2014 11:53, schrieb B.R.:

> Check the OpenSSL library your nginx has been linked against. I suggest you  
> update that package on your system and retry.  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx) [1]  
> Links:
