Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check if a connection uses ssl?

I'm coding a file exchange and some files shouldnt be downloaded without ssl. So I need to check if a connection is ssl encoded or not. Does this depend to the webserver or is there any method for all webservers?

like image 474
davidb Avatar asked Oct 19 '11 15:10

davidb


People also ask

How do you check if a site uses SSL or TLS?

Enter the URL you wish to check in the browser. Right-click the page or select the Page drop-down menu, and select Properties. In the new window, look for the Connection section. This will describe the version of TLS or SSL used.

How can I tell if MySQL uses SSL?

Run this in the session you want to verify: SELECT * FROM performance_schema. session_status WHERE VARIABLE_NAME IN ('Ssl_version','Ssl_cipher'); If you get the cipher and version strings, then the connection is encrypted.

How can you tell that the customer's site is not using https?

Look in your browser's top address bar for "https://" at the beginning of the website's address. The URLs of unencrypted websites begin with "http://" or you may not see that part of the address at all, depending on your browser.


1 Answers

You should be able to check request.ssl? to determine this.

As far as I can tell this is essentially just testing against request.proto to see if it is "https://".

like image 154
tadman Avatar answered Oct 03 '22 20:10

tadman