cannot load certificate "/usr/local/etc/nginx/key/f5e949f2-0d6b-42a8-8c52-9706945f9454.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/etc/nginx/key/f5e949f2-0d6b-42a8-8c52-9706945f9454.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
...stream {... # UPSTREAM SERVERS upstream upstream123dd4ddf4c74e86bce785b2817d5096 { hash $remote_addr consistent; server IP:636 weight=1 max_conns=5 max_fails=2 fail_timeout=20; server IP:636 weight=1 max_conns=5 max_fails=2 fail_timeout=20; } # upstream maps include opnsense_stream_vhost_plugins/*.conf; # servers server { listen 63636 ssl; listen [::]:63636 ssl; access_log /var/log/nginx/stream_f5e949f2-0d6b-42a8-8c52-9706945f9454.access.log main; error_log /var/log/nginx/stream_f5e949f2-0d6b-42a8-8c52-9706945f9454.error.log info; ssl_client_certificate /usr/local/etc/nginx/key/f5e949f2-0d6b-42a8-8c52-9706945f9454_ca.pem; ssl_verify_client off; ssl_certificate_key /usr/local/etc/nginx/key/f5e949f2-0d6b-42a8-8c52-9706945f9454.key; ssl_certificate /usr/local/etc/nginx/key/f5e949f2-0d6b-42a8-8c52-9706945f9454.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_dhparam /usr/local/etc/dh-parameters.4096; ssl_ciphers 'ECDHE-ECDSA-CAMELLIA256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CAMELLIA256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-CAMELLIA128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-CAMELLIA128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-CAMELLIA256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-CAMELLIA256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-CAMELLIA128-SHA256:ECDHE-RSA-AES128-SHA256'; ssl_session_timeout 1d; ssl_session_cache shared:sslcachef5e949f20d6b42a88c529706945f9454:50m; ssl_session_tickets off; ssl_prefer_server_ciphers on; proxy_ssl on; proxy_pass upstream123dd4ddf4c74e86bce785b2817d5096; proxy_protocol off; }}...
configctl nginx restart
drwxr-x--- 2 root wheel 512 Jan 11 10:39 .drwxr-xr-x 6 root wheel 512 Jan 11 10:22 ..-rw------- 1 root wheel 0 Jan 11 11:58 trust_upstream_123dd4dd-f4c7-4e86-bce7-85b2817d5096.pem
2021-01-11T22:47:22 configd.py[20102] [cf2d62f8-6b50-41c4-96ad-32fde3196537] returned exit status 12021-01-11T22:47:21 configd.py[20102] [cf2d62f8-6b50-41c4-96ad-32fde3196537] restarting nginx2021-01-11T22:46:57 configd.py[20102] [4b91bdca-a882-417e-b71e-c578a7fb58d6] returned exit status 12021-01-11T22:46:57 configd.py[20102] [4b91bdca-a882-417e-b71e-c578a7fb58d6] starting nginx2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //etc/newsyslog.conf.d/nginx2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //usr/local/etc/php-fpm.d/webgui.conf2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //usr/local/etc/php-fpm.d/www.conf2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //etc/rc.conf.d/php_fpm2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //usr/local/etc/nginx/mime.types2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //usr/local/etc/nginx/nginx_web.conf2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //usr/local/etc/nginx/nginx.conf2021-01-11T22:46:57 configd.py[20102] OPNsense/Nginx generated //etc/rc.conf.d/nginx2021-01-11T22:46:55 configd.py[20102] [531046f7-c20b-48ea-9a1d-8c50c13ef04a] trigger config changed event2021-01-11T22:46:55 configd.py[20102] generate template container OPNsense/Nginx2021-01-11T22:46:55 configd.py[20102] [2ef28f04-4391-4987-a910-a2111951eb69] generate template OPNsense/Nginx
# configctl nginx restartError (1)
/usr/local/opnsense/scripts/nginx/setup.php
/key only the cert for the upstream server is still 0 byte....
if (!empty($upstream['tls_trusted_certificate'])) { $cas = array(); if (is_array($http_server['ca'])) { foreach ($http_server['ca'] as $caref) { $ca = find_ca($caref); if (isset($ca)) { $cas[] = $ca; } } } export_pem_file( '/usr/local/etc/nginx/key/trust_upstream_' . $upstream_uuid . '.pem', implode("\n", $cas) ); }