Re: ssl_stapling without ssl_trusted_certificate

2019-04-11 Пенетрантность sergio via nginx-ru

On 11/04/2019 22:56, Maxim Dounin wrote:

Я подписан, не надо меня в cc включать.



Директиву error_log следует указывать на глобальном уровне.


Ага!


при каждом обращении к OCSP-серверу ругаясь в логи про "no resolver
defined to resolve ..." на уровне warn.


Действительно, ругается, всё встало на свои места, спасибо!




В случае, если resolver не указан, и при этом включён OCSP stapling
- nginx будет пытаться использовать IP-адреса OCSP-сервера, полученные
при старте


Полученные от кого?


--
sergio.
___
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: ssl_stapling without ssl_trusted_certificate

2019-04-10 Пенетрантность sergio via nginx-ru

On 01/04/2019 19:22, Maxim Dounin wrote:



Давайте пойдём простым путём.


Не похож он на простой.



Покажите вывод "nginx -V"


# nginx -V
nginx version: nginx/1.14.1
built with OpenSSL 1.1.0f  25 May 2017 (running with OpenSSL 1.1.0j  20 
Nov 2018)

TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 
-fdebug-prefix-map=/build/nginx-jqo7Nx/nginx-1.14.1=. 
-fstack-protector-strong -Wformat -Werror=format-security -fPIC 
-Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now 
-fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf 
--http-log-path=/var/log/nginx/access.log 
--error-log-path=/var/log/nginx/error.log 
--lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid 
--modules-path=/usr/lib/nginx/modules 
--http-client-body-temp-path=/var/lib/nginx/body 
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
--http-proxy-temp-path=/var/lib/nginx/proxy 
--http-scgi-temp-path=/var/lib/nginx/scgi 
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit 
--with-http_ssl_module --with-http_stub_status_module 
--with-http_realip_module --with-http_auth_request_module 
--with-http_v2_module --with-http_dav_module --with-http_slice_module 
--with-threads --with-http_gzip_static_module 
--without-http_browser_module --without-http_geo_module 
--without-http_limit_req_module --without-http_limit_conn_module 
--without-http_memcached_module --without-http_referer_module 
--without-http_split_clients_module --without-http_userid_module 
--add-dynamic-module=/build/nginx-jqo7Nx/nginx-1.14.1/debian/modules/http-echo






"nginx -T"


Тут очень много всего, куча серверов, 909 строк, и не всё я могу
показать. Давайте так:

# nginx -T | grep "resol\|stapl"
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
ssl_stapling on;
ssl_stapling_verify on;
#resolver localhost;




и debug log с обращением к OCSP-серверу


У меня дебиан, nginx-debug нету. Я просто взял и заменил warn на debug
в error_log на уровне http и на уровне server'а

один терминал: tail query.log
другой терминал: tcpdump на обращение к ocsp
ещё терминал: tail error.log (две штуки)


делаю /etc/init.d/nginx restart
в query.log вижу резолвинг oscp сервера, на двух остальных тихо

делаю
echo | openssl s_client -connect target:443 -status | grep -A20 'OCSP 
response'

...
OCSP response: no response sent

вижу обращение и ответ на tcpdump'е (Content-Type: 
application/ocsp-response)

вижу кучу невнятных записей в error.log со словами [debug], ни слова про
ocsp:

[debug] 30320#30320: *1 SSL certificate status callback
[debug] 30320#30320: *1 SSL_do_handshake: -1
[debug] 30320#30320: *1 SSL_get_error: 2
[debug] 30320#30320: *1 epoll add event: fd:55 op:1 ev:80002001
[debug] 30320#30320: *1 event timer add: 55: 6:4031539074
[debug] 30320#30320: *1 reusable connection: 0
[debug] 30320#30320: *1 SSL handshake handler: 0
[debug] 30320#30320: *1 SSL_do_handshake: 1
[debug] 30320#30320: *1 SSL: TLSv1.2, cipher: 
"ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) 
Mac=AEAD"

[debug] 30320#30320: *1 reusable connection: 1
[debug] 30320#30320: *1 http wait request handler
[debug] 30320#30320: *1 malloc: 56367BE9E750:1024
[debug] 30320#30320: *1 SSL_read: -1
[debug] 30320#30320: *1 SSL_get_error: 2
[debug] 30320#30320: *1 free: 56367BE9E750
[debug] 30320#30320: *1 http wait request handler
[debug] 30320#30320: *1 malloc: 56367BE9E750:1024
[debug] 30320#30320: *1 SSL_read: 1
[debug] 30320#30320: *1 SSL_read: 0
[debug] 30320#30320: *1 SSL_get_error: 6
[debug] 30320#30320: *1 peer shutdown SSL cleanly
[debug] 30320#30320: *1 reusable connection: 0
[debug] 30320#30320: *1 posix_memalign: 56367BE21560:4096 @16
[debug] 30320#30320: *1 http process request line
[info] 30320#30320: *1 client prematurely closed connection while 
reading client request line, client: , server: 

[debug] 30320#30320: *1 http finalize request: 400, "?" a:1, c:1
[debug] 30320#30320: *1 http terminate request count:1
[debug] 30320#30320: *1 http terminate cleanup count:1 blk:0
[debug] 30320#30320: *1 http request count:1 blk:0
[debug] 30320#30320: *1 http close request
[debug] 30320#30320: *1 http log handler
[debug] 30320#30320: *1 free: 56367BE21560, unused: 590
[debug] 30320#30320: *1 close http connection: 55
[debug] 30320#30320: *1 SSL_shutdown: 1
[debug] 30320#30320: *1 event timer del: 55: 4031539074
[debug] 30320#30320: *1 reusable connection: 0
[debug] 30320#30320: *1 free: 56367BE9E750
[debug] 30320#30320: *1 free: 56367BE7D4F0, unused: 24



делаю
echo | openssl s_client -connect target:443 -status | grep -A20 'OCSP 
response'

...
OCSP response:
DONE
==
OCSP Response Data:

в tcpdump'е в этот момент тишина,
в error log пачка абсолютно таких же записей как и в первый раз один в один


--
sergio.
___
nginx-ru mailing list