Bug 230681

Summary: benchmarks/httperf: for TLS > 1.0 first request send to server is garbage / random bits
Product: Ports & Packages Reporter: szander
Component: Individual Port(s)Assignee: Julien Laffaye <jlaffaye>
Status: New ---    
Severity: Affects Only Me CC: w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (jlaffaye)
Version: Latest   
Hardware: Any   
OS: Any   

Description szander 2018-08-16 23:36:51 UTC
When I use TLS 1.1 or TLS 1.2 the first request that is send to the server is completely garbage (looks like some random bits from memory rather than a HTTP request). Subsequent requests to the same server work fine. I'm not sure what precisely the issue is but I noted that core_ssl_connect() is written such that httperf can interleave other stuff while connecting. With a more "atomic" connect loop the problem is gone on my test machine: 

        while ((ssl_err = SSL_connect(s->ssl)) == -1) {
                int reason = SSL_get_error(s->ssl, ssl_err);

                if (reason != SSL_ERROR_WANT_READ &&
                    reason != SSL_ERROR_WANT_WRITE) {
                        fprintf(stderr,
                            "%s: failed to connect to SSL server (err=%d, reason=%d)\n",
                            prog_name, ssl_err, reason);
                        ERR_print_errors_fp(stderr);
                        exit(-1);
                }
        }
Comment 1 Walter Schwarzenfeld freebsd_triage 2019-08-13 05:09:46 UTC
Maintainer feedback!