Web Hosting Knowledge Base Web Hosting Knowledge Base
  • Home
Get Started
Web Hosting Knowledge Base Web Hosting Knowledge Base
Get Started
Web Hosting Knowledge Base Web Hosting Knowledge Base
  • Home
loading
  1. Home
  2. Getting Started
  3. Hostvento Hosting's Getting Started Guide
  4. Internet and networking information
  5. How to troubleshoot SSL connections with the openssl program
Updated on June 22, 2024

Getting Started

  • Folder icon closed Folder open iconShared Hosting Quick Start Guide
    • How to Change Nameservers in GoDaddy?
    • CloudLinux monitoring and limits
    • How to Create/Edit/Delete User Package with DirectAdmin?
    • How to Change the Time-zone in Webmail?
    • How to Add Email Filters from Webmail?
    • How to Claim Your Free .online Domain at Hostvento?
    • Managed WordPress Quick Start Guide
      • How to Update WordPress Installation?
      • How to Install WordPress Locally on Windows?
    • ProcessWire CMS
    • How to Buy Hosting from hostvento
    • Discover the Steps to Change a Password in Linux
    • How to change Domain Nameservers (DNS) of my Domain?
    • IP Deny Manager
    • What is SSH2 and how to install it
    • How to install eAccelerator on linux cPanel server ?
    • Do you support Magento eCommerce website
    • Discover the PHP Error Messages That Web Designers Should Know About
    • Learn to Use the Group Block in WordPress
    • How to determine the WordPress Version?
    • Learn to monitor blacklisted sites using Dropmysite
    • What is cPanel Hosting: A Complete Guide
    • How To Change The WordPress Auto-Save Interval?
    • Steps to Perform When the phprc File Isn’t Updating
    • How To Install Elgg Through Softaculous?
    • Steps to Redirect URLs Using Nginx
    • Using SMTP authentication to send email through WordPress
    • How To Configure The Display Options Of WooCommerce?
    • When Will Softaculous Provide With The Latest Version Of A Script/Application?
    • Know How To Set Constant FS_Method
    • How to Find Out the Latest Visitors to Your Website in cPanel?
    • How to Copy or Move Files in cPanel File Manager?
    • What Is a Parked(Alias) Domain and How Do I Set up One
    • Discover the Steps to Change a Password in Linux
    • How To Manage User Roles In Plesk?
    • How To Suspend And Unsuspend Accounts In WHM?
    • How to Connect to MySQL Using Python?
    • How To Change The Logo Of Your AbanteCart Store?
    • How To Create Custom Email Filters In cPanel?
    • How Do I Debug Magento MySQL Problems?
    • How to Add and Delete Email Account in Webuzo?
    • How to Add and Delete Email Account in Webuzo?
    • How to Add and Delete Email Account in Webuzo?
    • Learn to access phpMyAdmin and phpPgAdmin in cPanel
    • How to Restart a Server using Plesk?
    • SMF Hosting FAQ
    • Enable HTML files to display PHP Code
    • How to change your Plesk Password?
    • How to Check the Commission Status from Hostvento Affiliate Dashboard?
  • Folder icon closed Folder open iconUnmanaged VPS Quick Start Guide
  • Folder icon closed Folder open iconReseller Quick Start Guide
  • Folder icon closed Folder open iconUnmanaged Dedicated Server Quick Start Guide
  • Folder icon closed Folder open iconOrdering a hosting package
  • Folder icon closed Folder open iconHow to help secure your website
    • How To Secure Your Website's Software
  • Folder icon closed Folder open iconHostvento Hosting's Getting Started Guide
    • How to use the Knowledge Base
    • Shared Hosting Quick Start Guide
    • Managed WordPress Quick Start Guide
    • Reseller Quick Start Guide
    • Managed Dedicated Server Quick Start Guide
    • Unmanaged Dedicated Server Quick Start Guide
    • Ordering a hosting package
      • How to order a shared web hosting package
      • How to order a reseller hosting package
      • How to order an unmanaged Dedicated Server
      • How to order a managed Dedicated Server
      • How to use Hostvento Hosting coupons and discounts
    • Registering a domain
      • How to choose an effective domain name
      • How to protect your domain name
      • How to register and use internationalized domain names (IDNs)
      • .us Domain Name & Nexus Requirements Guide
      • Requirements for registering Canadian .ca domain names
      • Reactivating an expired domain
      • Validating your domain with ICANN
    • Configuring domain settings
      • Introduction to domain names and DNS
      • How to update the nameservers at third-party registrars
      • How to transfer a domain to Hostvento Hosting
      • How to set the name servers for a domain to point to Hostvento Hosting
      • How to access your web site before DNS propagation is complete
      • How to configure custom name servers
      • How to configure reverse DNS
      • How to set the name servers for a domain at OpenSRS
      • How to set the name servers for a domain registered at GoDaddy
      • How to change your account's primary domain name
      • How to use shared URLs to access your site
      • How to add an SRV record to a domain
      • How to use Anycast DNS with a web hosting account
      • What are subdomains, addon domains, and parked domains?
      • What are wildcard subdomains?
      • How to find the IP address for your hosting account
      • How to configure a .dk hosted custom name server
      • How to check a domain's automatic renewal status
      • How to verify site ownership with Google
      • What is a DNS TXT record?
    • Accessing your account
      • Accessing your hosting control panel
      • How to use SSH (Secure Shell) on Windows and Mac to access your account
      • How to access your account using SSH keys
      • Using FTP (File Transfer Protocol)
      • How to use Secure Copy Protocol(SCP) to transfer files securely on Windows and Mac
      • How to set up SFTP access for multiple users
      • How to use SSHFS (Secure Shell Filesystem)
      • How to use the SolusVM control panel to administer an unmanaged VPS
      • How to disable SSH logins for the root account
      • How to enable two-factor authentication for SSH
      • Warning message when you try to connect to a server using SSH
      • How to keep SSH connections alive
      • 'Output truncated' message when you try to list files using FTP
      • FTP accounts do not work after FileZilla upgrade
      • 'Too many connections from this IP' error message
      • How to change the SSH server port number
      • How to use FTP with Linux hosting accounts
    • How to set up e-mail for your web site
      • Configuring and accessing your e-mail
      • How to troubleshoot e-mail access problems
      • How to add signatures to webmail
      • An introduction to e-mail protocols
      • Accessing e-mail accounts through webmail
      • How to access e-mail accounts with client applications
      • How to troubleshoot e-mail accounts
      • E-mail client application setup
      • Messages are not copied to the Sent folder when using IMAP
      • How to view e-mail message headers
      • Using external SMTP servers to send e-mail
      • How to troubleshoot Apple (Mac) Mail
      • How to securely monitor e-mail using MailChannels
      • Using a catch-all e-mail address
    • How to migrate your data to Hostvento Hosting
      • Migrating an account from another web host
      • How to migrate e-mail from another host to Hostvento Hosting
      • Differences between site migrations and domain transfers
      • What is included and not included in cPanel migrations?
    • Backing up your data
      • How to back up data on shared hosting and reseller accounts
      • How to use Amazon S3 to back up and restore data
      • How to use Hostvento Cloud Backup
      • How to create e-mail backups
      • How to use Google Drive to back up and restore data
    • How to publish your web site
      • How to create and publish a site with the Hostvento Website Builder
      • How to publish your web site with Sandvox
      • How to publish your website with WebSite X5
      • How to publish your web pages with Google Web Designer
      • How to publish your web site with HTML-Kit
      • How to publish your web site with iWeb
      • How to publish your web site with Web Architect
      • How to publish your web site with PageBreeze
      • How to publish your web site with Dreamweaver
      • How to publish your web site with Web Easy Professional
      • How to publish your web site with Seamonkey
      • How to publish your web site with RapidWeaver
      • How to publish your web site with 90 Second Website Builder
      • How to publish your web site with Microsoft FrontPage
      • How to publish and edit files with UltraEdit
      • How to publish your web site with NetObjects Fusion
      • How to publish your web site with Freeway
      • How to publish and edit files with Sublime Text
      • How to publish your web site with Muse
    • Working with Linux
      • Introduction to Linux commands
      • How to work with compressed files on Microsoft Windows
      • How to edit text files from the command line
      • How to edit .htaccess files
      • How to compress files using cPanel or the command line
    • Internet and networking information
      • How to clear a web browser's cache and cookies
      • How to clear the DNS cache on your computer
      • How to clear the SSL state in a browser
      • Introduction to network troubleshooting
      • How to troubleshoot network connectivity using ping and traceroute
      • How to test DNS with dig and nslookup
      • How to troubleshoot network applications with telnet
      • How to troubleshoot SSL connections with the openssl program
      • Web pages display incorrectly on mobile devices
      • How to reduce backscatter and spam
      • How to check your website for broken links
      • How to troubleshoot network applications with curl
      • How to troubleshoot network applications with PowerShell and tnc
      • How to troubleshoot nameserver errors
      • Off-shore IP addresses
      • Google Chrome error message: "ERR_QUIC_PROTOCOL_ERROR"
      • How to set up a Wi-Fi hotspot on your mobile device
      • How to clear the DNS cache on macOS
      • How to change your DNS provider to reduce DNS propagation delays
    • Hostvento Hosting Policy FAQ
    • Why should I choose Hostvento Hosting?
    • What makes Hostvento Hosting’s service fast?
    • Solid State Drive (SSD) advantages
    • How To Start A Blog
    • How To Launch An eCommerce Website
    • How to determine your account's server name
    • Common web hosting terms and definitions
    • How to start a blog
      • How to start and run a blog
      • How to get started with WordPress
      • How to install and run a Nibbleblog site
      • Beyond WordPress basics
    • Top-level domain (TLD) availability
    • How to start a website on your hosting plan
    • How to determine which data center hosts your account
  • Folder icon closed Folder open iconEasy Website Software Setup Guide
  • Folder icon closed Folder open iconApplication optimization and configuration
    • How to enable the Redis extension for PHP
  • Folder icon closed Folder open iconSoftaculous 1-click application installer
    • When Will Softaculous Provide With The Latest Version Of A Script/Application?
    • How to use the Softaculous WordPress Manager
  • Folder icon closed Folder open iconHow to access the Hostvento Hosting Customer Portal
  • Folder icon closed Folder open iconHow to configure your domain to use Ezoic
  • Folder icon closed Folder open iconHow to back up and restore databases in Plesk
  • Folder icon closed Folder open iconHow to activate and configure Cloudflare ServerShield using the Plesk control panel
  • Folder icon closed Folder open iconHow to manage local backups on Dedicated servers
  • Folder icon closed Folder open iconHow to determine if your hosting account uses CloudLinux
  • Folder icon closed Folder open iconTurboHub: centralized, simplified WordPress site management from Hostvento Hosting

How to troubleshoot SSL connections with the openssl program

Estimated reading: 8 minutes 131 views

This article describes how to use the openssl program to troubleshoot SSL connections.Table of Contents

  • About OpenSSL
  • Installing the openssl program
  • Using the openssl program to troubleshoot
  • Establishing a connection
  • Troubleshooting SSL certificates
  • Troubleshooting HTTP connections
  • Troubleshooting IMAP and POP connections
  • More Information

About OpenSSL

OpenSSL is an open-source implementation of the SSL and TLS protocols. It includes several code libraries and utility programs, one of which is the command-line openssl program.

The openssl program is a useful tool for troubleshooting secure TCP connections to a remote server. In addition to testing basic connectivity, openssl enables you to send raw protocol commands for additional testing.

To test non-secure connections, use the telnet program instead. For information about how to do this, please see this article.

Installing the openssl program

Linux and Mac OS X include the openssl program by default. On Microsoft Windows, however, you must download and install openssl. To do this, follow these steps:

  1. Use your web browser to visit https://www.openssl.org/community/binaries.html.
  2. Click the OpenSSL for Windows hyperlink that includes Pre-compiled Win32/64 libraries without external dependencies.
  3. Download the most recent OpenSSL version for your PC architecture:
    • If you have a 32-bit computer, select a file whose name ends in win32.zip. For example, at the time this article is written, the newest version is openssl-1.0.2d-i386-win32.zip.
    • If you have a 64-bit computer, select a file whose name ends in win64.zip. For example, at the time this article is written, the newest version is openssl-1.0.2d-x64_86-win64.zip.
  4. Extract the .zip file to a folder (you can use any folder, and you can name the folder anything you want).
  5. After you extract the files, the folder contains the openssl.exe file and supporting files.
  6. To run openssl, open a command prompt window, use the cd command to change to the folder where you extracted the files in step 5, and then type openssl.

Using the openssl program to troubleshoot

To troubleshoot a secure connection using the openssl program, you must know at least two things:

  • The remote server name or IP address.
  • The port number for the network application you want to test.

If you are only testing basic connectivity to a particular application, that is all you need. If you want to do more in-depth testing, however, you will need to know specific commands for the protocol you want to test (for example, IMAP or HTTP).

Establishing a connection

To open a connection to a remote server, open a terminal window on your computer, and then type the following command. Replace example.com with the domain name (or IP address) of the server, and replace port with the TCP port number of the protocol you want to test:

Copyopenssl s_client -connect example.com:port

For a complete list of assigned TCP port numbers, please visit http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.

When you try to establish a secure connection to a remote server using openssl, one of two things happens:

  • The server accepts the connection. If this happens, openssl may display some text from the server, or simply await further input. You can then send raw commands appropriate for the protocol you are testing.
  • The server rejects the connection. If this happens, you receive a message such as connect: Connection timed out or connect:errno=110. If you receive this message, confirm you are using the correct server and port number. If you are, then the server is not accepting secure connections on the specified port.

The following sections demonstrate how to do basic troubleshooting with some common types of secure connections.

Troubleshooting SSL certificates

You can use the openssl program to test and verify SSL certificates. For example, you can check whether a certificate is signed by a valid Certificate Authority (CA) or is self-signed. You can also examine the certificate’s validity, expiration date, and much more.

To do this, type the following command. Replace example.com with your own domain name:

Copyopenssl s_client -connect example.com:443 -servername example.com -showcerts | openssl x509 -text -noout

SSL certificates are most commonly used to secure web sites, so the command above uses port 443 (HTTPS). However, if you have an unmanaged server, you may be using an SSL certificate to secure other services (for example, IMAP or Asterisk) instead of HTTP. If so, use the port number for that protocol instead.

The following sample output shows some important lines marked in bold:

$ openssl s_client -connect example.com:443 -servername example.com -showcerts | openssl x509 -text -noout
depth=1 C = BE, O = GlobalSign nv-sa, CN = AlphaSSL CA - SHHostvento56 - G2
verify return:0
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            31:11:4a:f7:c9:0e:fa:ff:9c:de:ad:be:ef:8a:84:1d:66:53
    Signature Algorithm: shhostvento56WithRSAEncryption
        Issuer: C=BE, O=GlobalSign nv-sa, CN=AlphaSSL CA - SHHostvento56 - G2
        Validity
            Not Before: Jun 11 19:26:24 2015 GMT
            Not After : Jun 11 19:26:24 2016 GMT
        Subject: OU=Domain Control Validated, CN=*.example.com

[Output truncated]

In this output, you can see that the certificate is issued by a Certificate Authority (CA) and uses a SHA-256 fingerprint. Additionally, the certificate expires on June 11, 2016.

If this were a self-signed certificate, openssl would display the following lines:

verify error:num=18:self signed certificate
verify return:1
Troubleshooting HTTP connections

Web server testing is a very common troubleshooting scenario. With openssl, you can open a secure connection to a remote server on port 443, and then send raw HTTP commands. For example, the following text shows an exchange between an openssl client and a remote web server. Text in red represents commands typed by the user:

$ openssl s_client -connect example.com:443
CONNECTED(00000003)
depth=1 C = BE, O = GlobalSign nv-sa, CN = AlphaSSL CA - SHHostvento56 - G2
verify return:0
---
Certificate chain
 0 s:/OU=Domain Control Validated/CN=*.example.com
   i:/C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHHostvento56 - G2
 1 s:/C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHAHostvento56 - G2
   i:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----

[Output truncated]

-----END CERTIFICATE-----
subject=/OU=Domain Control Validated/CN=*.example.com
issuer=/C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHHostvento56 - G2
---
No client certificate CA names sent
---
SSL handshake has read 3042 bytes and written 424 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384

[Output truncated]

Escape character is '^]'.

HEAD / HTTP/1.1
Host: example.com

HTTP/1.1 200 OK
Date: Tue, 18 Aug 2015 16:07:15 GMT
Server: Apache
X-Powered-By: PHP/5.3.27
Content-Type: text/html

In this exchange, openssl opens a connection to example.com on port 443 (HTTP secure port). The user receives information about the SSL certificate, as well as the ciphers that are in use. The user then sends a raw HTTP command (HEAD). The HTTP response confirms that the web server is accepting connections and responding to requests on port 443.

Troubleshooting IMAP and POP connections

Similar to the procedure for web server troubleshooting, you can test secure POP (port 995) and IMAP (port 993) connectivity.

The following text shows a sample exchange between an openssl client and a remote IMAP server. Text in red represents commands typed by the user:

$ openssl s_client -connect example.com:993
CONNECTED(00000003)
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHHostvento High Assurance Server CA
verify return:0
---
Certificate chain
 0 s:/C=US/ST=Washington/L=Bellingham/O=Example.com, Inc./CN=*.example.com
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHHostvento High Assurance Server CA
 1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHHostvento High Assurance Server CA
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----

[Output truncated]

-----END CERTIFICATE-----
subject=/C=US/ST=Washington/L=Bellingham/O=Example.com, Inc./CN=*.example.com
issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHHostvento High Assurance Server CA
---
No client certificate CA names sent
---
SSL handshake has read 3419 bytes and written 488 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit

[Output truncated]

---
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE NAMESPACE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
QUIT

The responses show that the server is accepting connections and responding to requests on port 993. Additionally, the line that starts with * OK shows that IMAP is running and ready for requests.

Learn more – How to clear the Smarty cache in PrestaShop

Still stuck? How can we help?

How can we help?

Was this page helpful? Yes No

Share this Doc

How to troubleshoot SSL connections with the openssl program

Or copy link

Clipboard Icon
CONTENTS
  • About OpenSSL
  • Installing the openssl program
  • Using the openssl program to troubleshoot
    • Establishing a connection
    • Troubleshooting SSL certificates
    • Troubleshooting HTTP connections
    • Troubleshooting IMAP and POP connections
Leaf Illustration

© 2023 All Rights Reserved by Hostvento