intel / asynch_mode_nginx

Other
210 stars 61 forks source link

Bug fix the switch 'ssl_asynch on/off' of asynch_mode_nginx #56

Closed oyaya closed 1 year ago

oyaya commented 2 years ago
 Configuration:
     load_module modules/ngx_ssl_engine_qat_module.so;
          ssl_engine{
                 use_engine qatengine;
                  …….
            }
            http {
                     ssl_asynch  on;
                     ssl_protocols        TLSv1.2;
                     ……
                      server {
                    listen 80; 
                    listen 443 ssl;
                    server_name  test.async.nginx;
                    location / { 
                            root html;
                        index  index.html index.htm;
                    }   
                          }
                }

Then, send a request and get a wrong result HTTP/1.1 400 Bad Request. image By reading the code and nginx docs, I find the switch ssl_asynch is designed by a similar mechanism to ssl on/off. Maybe we should make sure the above configuration can work.Another reason is that some times there are many server int http block. image Test case: ①

load_module modules/ngx_ssl_engine_qat_module.so;
ssl_engine{
        use_engine qatengine;
    …….
}
http {
      ssl_asynch  on;
      ssl_protocols        TLSv1.2;
      ……
     server {
             listen 80; 
             listen 443 ssl;
         listen 4433 asynch;
             server_name  test.async.nginx;
         location / { 
                     root html;
                 index  index.html index.htm;
            }   
        }
}

load_module modules/ngx_ssl_engine_qat_module.so;
ssl_engine{
      use_engine qatengine;
   …….
}
http {
      ssl_protocols        TLSv1.2;
      ……
      server {
              listen 80; 
              listen 443 ssl;
          listen 4433 asynch;
              server_name  test.async.nginx;
              location / { 
                    root html;
                index  index.html index.htm;
             }   
           }
}

load_module modules/ngx_ssl_engine_qat_module.so;
ssl_engine{
       use_engine qatengine;
   …….
}
http {
        ssl on;
        ssl_protocols        TLSv1.2;
         ……
server {
         listen 80; 
         listen 443 ssl;
    listen 4433 asynch;
         server_name  test.async.nginx;
         location / { 
                  root html;
                 index  index.html index.htm;
         }   
}
        }

load_module modules/ngx_ssl_engine_qat_module.so;
ssl_engine{
     use_engine qatengine;
   …….
}
http {
      ssl on;
      ssl_asynch  on;
      ssl_protocols        TLSv1.2;
……
server {
         listen 80; 
         listen 443 ssl;
     listen 4433 asynch;
         server_name  test.async.nginx;
         location / { 
                     root html;
                 index  index.html index.htm;
          }   
      }
}

We get the right result of the test cases blow in ① 、 ② 、③、④ curl -svo /dev/null https://test.async.nginx:443/index.html --resolve test.async.nginx:443:127.0.0.1 -k curl -svo /dev/null https://test.async.nginx:4433/index.html --resolve test.async.nginx:4433:127.0.0.1 -k We also get the right result of test case below in ① and ② curl -vo /dev/null http://test.async.nginx/index.html -x 127.0.0.1:80
But because of the switch ssl on/off we can’t get right result in ③ and ④;Maybe we could let it be or fix it in the project “nginx” curl -vo /dev/null http://test.async.nginx/index.html -x 127.0.0.1:80 image

ShuaiYuan21 commented 2 years ago

This issue has been reproduced, and we will review the patch next week. Thanks!

ShuaiYuan21 commented 1 year ago

Close this PR due to no update, if needed, feel free to reopen.