0

I need to write a new JAVA program from a PHP old version.

In PHP they used HTTP_SSL_PROTOCOL to get TLSv1 or TLSv1.2 and HTTP_SSL_CIPHER to get AES128-SHA or other .. to get info of the client.

    private function getInfos() {
    // Récupération du protocole
    if(isset($_SERVER) && isset($_SERVER['HTTP_SSL_PROTOCOL'])) {
        $this->protocol = $_SERVER['HTTP_SSL_PROTOCOL'];
    }

    // Récupération du Cipher
    if(isset($_SERVER) && isset($_SERVER['HTTP_SSL_CIPHER'])) {
        $this->cipher = $_SERVER['HTTP_SSL_CIPHER'];
    }
}

In JAVA with Tomcat I'm not able to get it on my HttpServletRequest, I check Tomcat help but didn't find anything :( I try to get it from HTTP header didn't get anything.

Thanks

Bosshoss
  • 783
  • 6
  • 24
  • You are writing Java server code? Like servlet? Then SSL is taken care automatically. If you are writing Java client, then you can post some of the code. – Teddy Dec 03 '18 at 11:03
  • If you still need to know the info just for logging, etc., you can maybe mention why you need that info. – Teddy Dec 03 '18 at 11:04
  • 1
    I write a JAVA server with servlet. Its for a bank and I need to know who use TLSv1 to contact them and tell that he need to use TLSv1.2, same with Cipher. – Bosshoss Dec 03 '18 at 11:18
  • Apparently it wasn't possible: https://stackoverflow.com/q/41813852/1364747 But there is some discussion about workarounds. – Teddy Dec 03 '18 at 11:20

0 Answers0