How to enable only TLS v1.2 in Apache web server - linux

Good Day,
I have a apache web server in Linux, and I want to enable the only TLSv1.2
I tried to applied to many methods, But i can't.
How to enable only TLS v1.2 in Apache web server??
spec:
OpenSSL 1.0.2k-fips
Server version: Apache/2.4.39
ssl.conf:
SSLProtocol -all +TLSv1.2
SSLProxyProtocol -all +TLSv1.2
SSLHonorCipherOrder on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-GCM- SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GC$
SSLProxyCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GC$
And i have tried to aplied these.
SSLProtocol -ALL +TLSv1.2
SSLProxyProtocol -ALL +TLSv1.2
or
SSLProtocol TLSv1.2
SSLProxyProtocol TLSv1.2
But..
openssl s_client -connect domain -tls1 => Secure Renegotiation IS supported
openssl s_client -connect domain:443 -tls1_1 => Secure Renegotiation IS supported
openssl s_client -connect domain:443 -tls1_2 => Secure Renegotiation IS supported
TLSv1.0, TLSv1.1 are still enbled.

Related

openssl certificate error for WinRM connection

I have on Windows server certificate which is valid and active and WinRM listener is active as well on port 5986 (telnet works) for WinRM connection that needs to be established from the Linux server.
I didn't copy that certificate anywhere on the linux server as I do not know where that should be or how it should be configured.
If I try to establish WinRM connection I am getting this error on the Linux server.
openssl s_client -connect 10.7.147.210:5986
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA
Server Temp Key: ECDH, P-384, 384 bits
---
SSL handshake has read 1367 bytes and written 447 bytes
Verification error: unable to verify the first certificate
I tried by referencing CAfile and CApath and cert option but without success:
openssl s_client -cert winrmcert.pem -key winrmcert.key -CApath . -connect 10.7.147.210:5986
openssl s_client -CAfile winrmcert.pem -connect 10.7.147.210:5986
Can you please help me what I need to do and configure on Linux server for certificate generated on Windows server for WinRM connection? I am not the expert for this topic so I would appreciate all useful instructions. Thank you

How can I know the SHA type in OpenSSL ChaCha cipher

I want to check OpenSSL 1.1.0g against an application ciphersuite lists. The application I have has ciphersuites as follows:
ecdhe-ecdsa-chacha20-poly1305-sha256
ecdhe-rsa-chacha20-poly1305-sha256
By checking Openssl TLS 1.2 ciphers using the command: openssl ciphers -s -tls1_2 -V I got some ChaCha ciphersuites as follows:
0xCC,0xA9 - ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD
0xCC,0xA8 - ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=RSA Enc=CHACHA20/POLY1305(256) Mac=AEAD
The only difference is that OpenSSL ciphersuite name does not contain the SHA type. There are many SHA types (256, 384, etc.). How can I know what is the SHA type in OpenSSL ciphersuites?
openssl ciphers shows you the codes for this ciphers, i.e. 0xCC,0xA9 and 0xCC,0xA8. According to IANA these codes map to TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 and TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 which are both defined in RFC 7905.

SSL routines:ssl23_write:ssl handshake failure:s23_lib.c:177

I have created Azure VM and installed my application on it.
Created JKS file and configured SSL in my application.
I have restricted my Azure VM to access from particular source IP.
When I try to access from that source IP, I am not able to access my application from browser. It says "Site not found" error.
openssl s_client -connect 10.6.0.10:443
CONNECTED(00000003)
139868717622936: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 305 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1510229915
Timeout : 300 (sec)
Verify return code: 0 (ok)

Cannot disable SSLv3 on Amazon Linux Instance

I am using SSL Certificate issued by Go Daddy.
On my Linux Instance following are the software details :-
Apache Version - Apache/2.4.16 (Amazon)
Openssl Version - OpenSSL 1.0.1k-fips 8 Jan 2015
mod_ssl version - mod_ssl-2.4.2
Note :- I install Apache from RPM Package and later I install mod_ssl and openssl from rpm package.
1) The problem is when I disable SSLv3 and test SSL Server from https://www.ssllabs.com/ssltest/ it gives me warning that "this server does not support TLSv1.2 which is current best" and when I enable TLSv1.2 protocol the same test warns me about "This server supports SSLv3 protocol and vulnerable to Poodle attack"
How to disable SSLv3 and enable TLSv1.2 at same time on server?
Current configuration of my Vhost file about SSL is:
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
2) I cannot create a Strong Diffie-Hellman Group. Current is 1024-bit Diffie-Hellman group and want to create 2048-bit group for the site.
I issue this command to generate 2048-bit key:-
openssl dhparam -out dhparams.pem 2048
and my configuration in VHost is:
SSLOpenSSLConfCmd DHParameters /etc/httpd/dhparams.pem
when I restart server error message pop up:
Invalid command 'SSLOpenSSLConfCmd', perhaps misspelled or defined by a module not included in the server configuration
How to resolve this issue?
Output of command openssl s_client -connect 127.0.0.1:443 -tls1_2 -msg when SSLv3 is enabled :-
CONNECTED(00000003)
>>> ??? [length 0005]
>>> TLS 1.2 Handshake [length 0138], ClientHello
<<< ??? [length 0005]
<<< TLS 1.2 Handshake [length 003a], ServerHello
<<< ??? [length 0005]
<<< TLS 1.2 Handshake [length 12a7], Certificate
depth=3 C = US, O = "The Go Daddy Group, Inc.", OU = Go Daddy Class 2
Certification Authority
verify error:num=19:self signed certificate in certificate chain
<<< ??? [length 0005]
<<< TLS 1.2 Handshake [length 020f], ServerKeyExchange
<<< ??? [length 0005]
<<< TLS 1.2 Handshake [length 0004], ServerHelloDone
>>> ??? [length 0005]
>>> TLS 1.2 Handshake [length 0086], ClientKeyExchange
>>> ??? [length 0005]
>>> TLS 1.2 ChangeCipherSpec [length 0001]
>>> ??? [length 0005]
>>> TLS 1.2 Handshake [length 0010], Finished
<<< ??? [length 0005]
<<< TLS 1.2 Handshake [length 00ca]???
<<< ??? [length 0005]
<<< TLS 1.2 ChangeCipherSpec [length 0001]
<<< ??? [length 0005]
<<< TLS 1.2 Handshake [length 0010], Finished
output of command openssl s_client -connect 127.0.0.1:443 -ssl3 -msg with SSLv3 disabled :-
>>> ??? [length 0005]
>>> SSL 3.0 Handshake [length 0099], ClientHello
<<< ??? [length 0005]
<<< SSL 3.0 Alert [length 0002], fatal handshake_failure
Output of command openssl s_client -connect 127.0.0.1:443 -tls1_2 -msg when SSLv3 is disabled :-
CONNECTED(00000003)
>>> ??? [length 0005]
>>> TLS 1.2 Handshake [length 0138], ClientHello
<<< ??? [length 0005]
>>> ??? [length 0005]
>>> TLS 1.0 Alert [length 0002], fatal protocol_version
SSL Debug Error Logs in Apache for command openssl s_client -connect 127.0.0.1:443 -tls1_2 -msg when SSLv3 is disabled :-
[Tue Nov 24 07:50:13.019993 2015] [ssl:info] [pid 6419] [client 127.0.0.1:32836] AH01964: Connection to child 2 established (server site1.example.com:443)
[Tue Nov 24 07:50:13.023693 2015] [ssl:info] [pid 6419] [client 127.0.0.1:32836] AH02008: SSL library error 1 in handshake (server site1.example.com:443)
[Tue Nov 24 07:50:13.023752 2015] [ssl:info] [pid 6419] SSL Library Error: error:1409442E:SSL routines:SSL3_READ_BYTES:tlsv1 alert protocol version (SSL alert number 70)
[Tue Nov 24 07:50:13.023789 2015] [ssl:info] [pid 6419] [client 127.0.0.1:32836] AH01998: Connection closed to child 2 with abortive shutdown (server site1.example.com:443)
sslscan --no-failed "site1.domain.com" command result when SSLProtocol all -SSLv2 -SSLv3 is used in configuration:-
sslscan --no-failed "site1.domain.com" command result when SSLProtocol all -SSLv2 -SSLv3 is not used in configuration:-
Both the results shows no sign of TLSv1.2 protocol.
I think sslscan only scan for SSLv3 and TLSv1.1 protocol. Not TLSv1.2
Now when I tested this result on SSLLab with SSLProtocol all -SSLv2 -SSLv3 is not used in configuration then :-
It says TLSv1.2 is enable.
Add this below line & check
SSLProtocol all -SSLv2 -SSLv3 +TLSv1.2
Along with SSLProtocol -all +TLSv1.2
Edit the following "SSLCipherSuite" in /etc/apache2/mods-available/ssl.conf.
from: SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 to:
SSLCipherSuite EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 \ EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 \ EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS

Tomcat 7.0.52 APR 1.1.29 native TLS Protocol Session Renegotiation Security Vulnerability TLS SSL Man In The Middle CVE-2009-3555

I am failing a server security scan on Windows 2008 R2, with
TLS Protocol Session Renegotiation Security Vulnerability TLS SSL Man In The Middle CVE-2009-3555
The scan results recommend an upgrade to openssl 0.9.8l or higher.
I am using the latest version of tcnative-1.dll (1.1.29 13/02/14) which, as I understand it is built using the native libraries and openssl libraries.
Is the only way I can resolve this is to build tcnative myself with the latest version of openssl?
Looking at the http://tomcat.apache.org/native-doc/ build section I need MS Visual Studio (which I don't have and have never used).
Has anybody else build it? If so I cannot find it.
This result is a false positive. I've performed various tests with various versions of Tomcat using the 1.1.29 APR/native connector and in none of those test did insecure renegotiation occur.
Note that Tomcat - depending on version, connector and configuration may support secure renegotiation.
The most definitive test was with OpenSSL 0.9.8.k (i.e. a version of OpenSSL that is vulnerable to CVE2009-3555 and will attempt an insecure renegotiation). When I try this, the connection blocks and eventually times out.
You need to find a better security scanner.
For completeness, the output of the test was:
$ ./openssl s_client -connect 192.168.23.9:8443
CONNECTED(00000003)
depth=1 /C=US/CN=ca-test.tomcat.apache.org
verify error:num=19:self signed certificate in certificate chain
verify return:0
---
Certificate chain
0 s:/C=US/CN=localhost
i:/C=US/CN=ca-test.tomcat.apache.org
1 s:/C=US/CN=ca-test.tomcat.apache.org
i:/C=US/CN=ca-test.tomcat.apache.org
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDSTCCAjGgAwIBAgICEAMwDQYJKoZIhvcNAQEFBQAwMTELMAkGA1UEBhMCVVMx
IjAgBgNVBAMTGWNhLXRlc3QudG9tY2F0LmFwYWNoZS5vcmcwHhcNMTMwMjI4MDUy
ODQyWhcNMTUwMjI4MDUyODQyWjAhMQswCQYDVQQGEwJVUzESMBAGA1UEAxMJbG9j
YWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5295PxiHkd0n
mDQkeVhH+cJpK9hbwOC7SlfWALW7arBmhFy48BIKJycynIIqLw9pd6bpDd9kMVHA
QR7c1HRRnKO4URNYc+4hnPljghvCLEnDCXD/qfOvogwLYC9q26UBRT40kI5naetF
8zQphds5ipnCD3IVIf1UNaZ7pzDLHk09MiTGS4RPX2D/ZF5oytj63ph9QARgt65Q
7MiMrt2UgUEYWwNjDysCYwqVau1+aOa21VbpTmDqHZVYM76iElXLf5zElwvbwJQJ
KrOf4Wt4DWMaQdVr29hIWQSI0RHV50UoDnwbeHUgff9/4dbq5MVRd0FCMEv/KTM9
iViUaVtwJwIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVu
U1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUMNurcJQ0yv11RqvO
4kqpnnS8abswHwYDVR0jBBgwFoAUsDu8yfooXz4EH5tsx4to2AGw+D0wDQYJKoZI
hvcNAQEFBQADggEBAKvT5ys1022fhypkWPFhy1aohCJ5rA1oH1UN3RYWcsSpdSoO
+LFzaMnuQ9hc+gddP0H7FBe+ZCHYHiVnkrLFu0MdlrbTvRzhpMfu4zcLkhRWyq2o
dluAyUKMifFCboz7odeY1W1Jmf629sbzzI8GVG4C9Y9L8YasFJNsdCUmRHpbgjxX
1uUUbrcpU+RAei8QXf8of+XlVGw4+rknlyppYLpKWihlsYHgt6F01uYHgW24WcNF
vXyoF2cf/FIabJCHTaGYUYwpaoTZDSSohmpearf5J5tSN5a1/ZQRysTZbWmB+pY0
Yzp8SS0GSK6xFFkSKY5ZPQOZQpDmgt8Iz9d37AA=
-----END CERTIFICATE-----
subject=/C=US/CN=localhost
issuer=/C=US/CN=ca-test.tomcat.apache.org
---
No client certificate CA names sent
---
SSL handshake has read 2433 bytes and written 322 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 2048 bit
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : DHE-RSA-AES256-SHA
Session-ID: E98ED9D885D761C7B23AF93DC15C53D0680AF2D8345A37699549E48C9D4E18AE
Session-ID-ctx:
Master-Key: FA2C87FB24C68186D1CC63FEEF459B7DE4BA0F304D60F2293AB3C1C23DF03566F51DDB61A9576A1FE9C021CB3438B4C7
Key-Arg : None
Start Time: 1395309769
Timeout : 300 (sec)
Verify return code: 19 (self signed certificate in certificate chain)
---
GET / HTTP/1.0
R
RENEGOTIATING
7087:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:530:

Resources