Skip to main content
wafikmaher
New Member
January 10, 2018
Question

Generate True Self-signed Certificate for SSL Inspection on Fortigate

  • January 10, 2018
  • 6 replies
  • 20756 views

The default self-signed certificate Fortinet_CA_Untrusted seems to be an issue, the WAD application debug (attached) shows failure of SSL proxy because of it. I know how to replace it with a CA-Signed certificate, however its preferred to fix the problem without an external CA. All Fortinet documents i came across, that mention self-signed certificates (ex. https://docs.fortinet.com/uploaded/files/1704/fortios_certificate_management.pdf), actually discusses about a private CA signed certificate. Is there any way to add a true self-signed (not CA-signed) certificate, or re-generate the default "Fortinet_CA_Untrusted".

6 replies

seadave
New Member
June 5, 2018

Thought I would mention something as we are fighting this right now.  Be very careful about using the latest docs when using openssl to self-sign a cert.  For instance this command:

 

openssl genrsa –des3 –out fgssl.key 2048   would generate a key using 3DES which is no longer suggested due to it being easier to compromise than it should be.  The current 6.0 documentation (https://docs.fortinet.com/d/fortigate-pdf-handbook-60) suggests:   openssl genrsa -aes256 -out fgtcapriv.key 2048   This creates the AES 256bit private key.  Then you need to generate the cert:   openssl req -new -x509 -days 3650 -extensions v3_ca -key fgtcapriv.key -out fgtca.crt   This creates a v3 CA Cert that is valid for 10 years from the date of creation.  As this cert is marked as a CA, it can be used for SSL/TLS DPI on a Fortigate, as long as you make sure this cert is installed as a Trusted Root CA in every machine/phone that will be attempting to run traffic through that policy.  In Windows you can do this by pushing it out via a group policy.   You cannot buy a CA cert for DPI on a Fortigate.  You need to use the built in one or sign one (self-sign) yourself.   But there is another issue.  When you issue this command, openssl will complain that you need an openssl.cnf file.  Creating this is not for the faint of heart.  This page has lots of good information on doing so:  

https://www.phildev.net/ssl/opensslconf.html

 

Here's the FortiCookbook pages, but they neglect to discuss the openssl.cnf issue.

http://cookbook.fortinet.com/preventing-certificate-warnings/

 

We are trying to generated a private key that uses ECDHE256.  We keep ending up with ECDSA256 which isn't what we want.  I'll post all the steps when I figure it out.

 

The main idea about signing your own cert is security.  Only you will have the private key and it will never have been anywhere else.  I'm not sure if the Fortinet built in SSLProxy certs are unique to each FG, but to be sure you sign your own and you back it up.  Then when you update your Fortigate you can reload it if anything goes wrong.  That saves you the hassle of having to push a new one out. 

 

That is our current predicament.  We created a v1 CA cert somehow, so now we need to create one that is v3 and redeploy that to all our devices before we move to 5.6 or 6.  Not fun.

 

If you want to learn about OpenSSL and how it relates to TLS and cert management this is a great resource:

 

https://www.feistyduck.com/books/openssl-cookbook/

emnoc
New Member
June 5, 2018

i would  not do this

 

 

openssl req -new -x509 -days 3650 -extensions v3_ca -key fgtcapriv.key -out fgtca.crt  

 

 

I would  sign it with a sha2 algo

 

openssl req -new -x509 -days 3650 -extensions v3_ca -key fgtcapriv.key -out fgca.crt -sha256

 

 

And regardless if you  use the selfSign or your own, it's still a selfSign cert. The only difference from yours and the installed one in the FGT, vrs a public known CA is that the latter is installed in all common browsers for the most part. And guess what?,  they are ALL a selfSign certificate

 

Ken

 

 

 

 

Duncan
New Member
November 11, 2018

emnoc wrote:

And regardless if you  use the selfSign or your own, it's still a selfSign cert. The only difference from yours and the installed one in the FGT, vrs a public known CA is that the latter is installed in all common browsers for the most part. And guess what?,  they are ALL a selfSign certificate

The point seadave correctly made, was the FortiGate cert isn't self-signed. Fortinet signed it. So we don't know for sure someone didn't steal the private key.

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT