Apstra 서버를 처음 부팅하면 고유한 자체 서명 인증서가 자동으로 생성되어 Apstra 서버에 /etc/aos/nginx.conf.d
저장됩니다(nginx.crt
는 웹 서버의 공개 키이며 nginx.key
는 개인 키입니다.) 인증서는 Apstra 서버 및 REST API를 암호화하는 데 사용됩니다. 내부 디바이스-서버 연결을 위한 것이 아닙니다. 시스템을 백업할 때 HTTPS 인증서는 유지되지 않으므로 폴더를 수동으로 백업 etc/aos
해야 합니다. 기본 SSL 인증서를 교체하는 것이 좋습니다. 웹 서버 인증서 관리는 최종 사용자의 책임입니다. 주니퍼의 지원은 최선의 노력입니다.
- 기존 OpenSSL 키를 백업합니다.
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
- 기본 제공 openssl 명령을 사용하여 새 OpenSSL 프라이빗 키를 생성합니다.
root@aos-server:/etc/aos/nginx.conf.d# openssl genrsa -out nginx.key 2048
Generating RSA private key, 2048 bit long modulus
.............+++
......+++
e is 65537 (0x10001)
주의:
또는 nginx.key
파일 이름을 수정 nginx.crt
하지 마십시오. 에서 참조nginx.conf
됩니다. 후속 서비스 업그레이드의 일부로 이러한 파일을 대체할 수 있으므로 파일 이름을 예측할 수 있어야 합니다.
또한 이 파일은 Apstra 서버 업그레이드 중에 교체될 수 있으며 변경 사항은 폐기되므로 에서 구성을 nginx.conf
변경하지 마십시오.
- 인증서 서명 요청을 만듭니다. Apstra 서버 HTTPS 서비스에 대한 주관적 대체 이름(SAN)으로 서명된 SSL 인증서를 생성하려면 OpenSSL 템플릿을 수동으로 생성해야 합니다. 자세한 내용은 주니퍼 지원 기술 자료 문서 KB37299를 참조하십시오.
주의:
고급 인증서 요청에 대한 사용자 지정 OpenSSL 구성 파일을 만든 경우 Nginx 구성 폴더에 그대로 두지 마세요. 시작 시 Nginx는 로드를 시도하여(*.conf) 서비스 오류를 일으킵니다.
root@aos-server:/etc/aos/nginx.conf.d# openssl req -new -sha256 -key nginx.key -out nginx.csr
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
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
- 인증 기관에 인증서 서명 요청(nginx.csr)을 제출합니다. 필요한 단계는 이 문서의 범위를 벗어납니다. CA 지침은 구현에 따라 다릅니다. 유효한 SSL 인증서가 작동합니다. 아래 예제는 인증서 자체 서명에 대한 것입니다.
root@aos-server:/etc/aos/nginx.conf.d# openssl req -x509 -sha256 -days 3650 -key nginx.key -in nginx.csr -out nginx.crt
root@aos-server:/etc/aos/nginx.conf.d#
- SSL 인증서가 개인 키, 공개 키 및 CSR과 일치하는지 확인합니다.
root@aos-server:/etc/aos/nginx.conf.d# openssl rsa -noout -modulus -in nginx.key | openssl md5
(stdin)= 60ac4532a708c98d70fee0dbcaab1e75
root@aos-server:/etc/aos/nginx.conf.d# openssl req -noout -modulus -in nginx.csr | openssl md5
(stdin)= 60ac4532a708c98d70fee0dbcaab1e75
root@aos-server:/etc/aos/nginx.conf.d# openssl x509 -noout -modulus -in nginx.crt | openssl md5
(stdin)= 60ac4532a708c98d70fee0dbcaab1e75
- 새 인증서를 로드하려면 nginx 컨테이너를 다시 시작합니다.
root@aos-server:/etc/aos/nginx.conf.d# docker restart aos_nginx_1
aos_nginx_1
root@aos-server:/etc/aos/nginx.conf.d
- 새 인증서가 웹 브라우저에 있고 새 인증서 일반 이름이 'aos-server.apstra.com'와 일치하는지 확인합니다.