Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Replace SSL Certificate on Apstra Server with Self-Signed One

date_range 30-May-23

When you boot up the Apstra server for the first time, a unique self-signed certificate is automatically generated and stored on the Apstra server at /etc/aos/nginx.conf.d (nginx.crt is the public key for the webserver and nginx.key is the private key.) The certificate is used for encrypting the Apstra server and REST API. It's not for any internal device-server connectivity. Since the HTTPS certificate is not retained when you back up the system, you must manually back up the etc/aos folder. We support and recommend replacing the default SSL certificate.

  1. Back up the existing OpenSSL keys.
    content_copy zoom_out_map
    admin@aos-server:/$ sudo -s
    [sudo] password for admin:
    
    root@aos-server:/# cd /etc/aos/nginx.conf.d
    root@aos-server:/etc/aos/nginx.conf.d# cp nginx.crt nginx.crt.old
    root@aos-server:/etc/aos/nginx.conf.d# cp nginx.key nginx.key.old
  2. If a Random Number Generator seed file .rnd doesn't exist in /home/admin, create one.
    content_copy zoom_out_map
    root@aos-server:~# touch /home/admin/.rnd
    root@aos-server:~#
  3. Generate a new OpenSSL private key and self-signed certificate.
    content_copy zoom_out_map
    root@aos-server:/etc/aos/nginx.conf.d# openssl req -newkey rsa:2048 -nodes -keyout nginx.key -x509 -days 824 -out nginx.crt -addext extendedKeyUsage=serverAuth -addext subjectAltName=DNS:apstra.com
    Generating a RSA private key
    ...........................................+++++
    .....................................................................................+++++
    writing new private key to 'nginx.key'
    -----
    You are about to be asked to enter information that will be incorporated
    into your certificate request.
    What you are about to enter is what is called a Distinguished Name or a DN.
    There are quite a few fields but you can leave some blank
    For some fields there will be a default value,
    If you enter '.', the field will be left blank.
    -----
    Country Name (2 letter code) [AU]:US
    State or Province Name (full name) [Some-State]:California
    Locality Name (eg, city) []:Menlo Park
    Organization Name (eg, company) [Internet Widgits Pty Ltd]:Apstra, Inc
    Organizational Unit Name (eg, section) []:
    Common Name (e.g. server FQDN or YOUR name) []:aos-server.apstra.com
    Email Address []:support@apstra.com
    root@aos-server:/etc/aos/nginx.conf.d#
  4. To load the new certificate, restart the nginx container.
    content_copy zoom_out_map
    root@aos-server:/etc/aos/nginx.conf.d# docker restart aos_nginx_1
    aos_nginx_1
    root@aos-server:/etc/aos/nginx.conf.d
footer-navigation