O'Reilly logo

Security with Go by John Daniel Leon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Generating a self-signed certificate

To create a self-signed certificate with Go, you need a public and private key pair. The x509 package has a function for creating a certificate. It requires the public and private key along with a template certificate with all the information. Since we are self-signing, the template certificate is also going to be used as the parent certificate doing the signing.

Each application can treat self-signed certificates differently. Some applications will warn you if a certificate is self-signed, some will refuse to accept it, and others will happily use it without warning you. When you write your own applications, you will have to decide if you want to verify certificates or accept self-signed ones.

The important ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required