Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 89F2D200BC4 for ; Fri, 4 Nov 2016 21:00:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 86C23160AFE; Fri, 4 Nov 2016 20:00:49 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 85F32160AEA for ; Fri, 4 Nov 2016 21:00:48 +0100 (CET) Received: (qmail 97467 invoked by uid 500); 4 Nov 2016 20:00:47 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 97450 invoked by uid 99); 4 Nov 2016 20:00:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 20:00:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D600D1A063B for ; Fri, 4 Nov 2016 20:00:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ojDUOsEzjlQF for ; Fri, 4 Nov 2016 20:00:43 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id EF3155F22F for ; Fri, 4 Nov 2016 20:00:42 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id p190so72331709wmp.1 for ; Fri, 04 Nov 2016 13:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Ay5A8+P6IHMZtrpDxuvtSXcbrMs6SVEZ0zKrdcFZN5Q=; b=tjdg/8Th6Lq3FKlMOP59VVHzqBqAnONDRkA9L3sbfKqSYP2fs1OKF6bzHufvDGRscX Om3aMYqCZIRHYLT8Qay0uWRS3fCFbRBuAesdfJhSGrl5i9Oi701d7bS9HiN6mCv1i93P 2q7C0eWtvulP/yfjDIZKQnl7EFxa4STCWf/RQtMDtK6PwN/Ddda4jbWSEchSaZhr8RIj XA2hnxzbRtCjd6hHpKDl+EK53jcIhNJiXe33FIpaYg0RVncI5c+RDws6Gz9DIvg91rYN TnxXa58HnWpDEJbwdrSzIMMvoSmp8ssU0CrUcq6KheCq4oo3L0Btd/ktyQsFOlgN4W6H lkWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Ay5A8+P6IHMZtrpDxuvtSXcbrMs6SVEZ0zKrdcFZN5Q=; b=dBF6Y9bhftx8RGkS532s4EQSIK+/DqyVfjlCA1jxSAyk2wqRjuEVkiuJng7hwdrh4S LMAfFHkYy5sIag/cgQQzbTaPspze9tU4Ii2qV7KoQ0Q9YPF2WtqthiY0KnW4pVGnZaE/ J4bObVDSvgUJkVxnDVe72PScoSUuIZJn16axKyhyxbwZm3xgqMxnJ1QKqzrQ0/mGJ4ji rpINRYMONnJ8ABvccr2y0O79Fv3TXAZO5g5UUneBmn6STl9Wdv4r6wmyfQH82+Mlf7oB mET3kAaK2QpJcRUznzbYHTzDmI6M0YC7spGNmRyfYq4sty8pRd14JOb02T2LOXBwweIv ZgIw== X-Gm-Message-State: ABUngvfKsxxPaBBvD1NAy4i9FAXyF3E4EhXKLJ2NGqYJwUITVLvsgo3jmN1Dh6Ub0lqGPnP9csJk5preUEB/Dw== X-Received: by 10.195.11.134 with SMTP id ei6mr13132612wjd.176.1478289630344; Fri, 04 Nov 2016 13:00:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.211.84 with HTTP; Fri, 4 Nov 2016 13:00:09 -0700 (PDT) In-Reply-To: References: <8737357ae3017c4c11eddaf0adefad13@gmail.com> <8c434c93183b6716b467449026a4e2bb@gmail.com> From: Stuart Barlow Date: Fri, 4 Nov 2016 20:00:09 +0000 Message-ID: Subject: Re: HttpClient SSL Handshake and self-signed certificate To: JMeter Users List Content-Type: multipart/alternative; boundary=047d7b8748184abb8405407f2035 archived-at: Fri, 04 Nov 2016 20:00:49 -0000 --047d7b8748184abb8405407f2035 Content-Type: text/plain; charset=UTF-8 Thanks Steven. That's just what I was looking for. On 30 October 2016 at 23:21, Steven Swor wrote: > Hi Stuart, > > The options you're looking for are at > http://jmeter.apache.org/usermanual/get-started.html#proxy_server > > Note that, for whatever reason, Sun decided it was a good idea to separate > non-proxy hosts by a pipe character instead of a comma, so if you're > running on a non-Windows system, you'll need to surround the non-proxy > hosts list with single-quote characters (e.g. -N 'server1|server2'), > otherwise the shell is likely to interpret the pipe character as a shell > pipe. > > Cheers, > Steve > > On Sat, Oct 29, 2016 at 5:26 AM, Deepak Shetty wrote: > > > Hi > > can you clarify what you mean. > > The JMeter Proxy is used for recording a script - as such the browser > needs > > to be configured to send all requests to JMeter for it to record it - you > > typically dont want to exclude things here (if you did , you'd configure > > the browser to bypass the JMeter proxy for some hosts) > > > > This is different from how JMeter/java itself needing a proxy to make its > > request successful (and Im guessing thats what you are referring to) > > http://jmeter.apache.org/usermanual/get-started.html#proxy_server see -N > > to > > ignore (not a 100% sure that this works with httpclient but you can test > > and see with different implementations) > > > > > > On Fri, Oct 28, 2016 at 3:35 AM, Stuart Barlow > > wrote: > > > > > Hi Ivan, > > > > > > Thanks for your reply and the suggestions. I did give them all a try > but > > > none worked. I eventually figured out what the problem is but might > still > > > need some advice on how to handle it. > > > > > > There's an HTTP proxy in place in the intranet I work on and the > website > > > I'm testing goes through the proxy for most things but for some pages > > (and > > > for some nested resources like images) there is a direct connection. > > > > > > In JMeter I don't see a way to tell it to ignore the proxy for > particular > > > HTTP URL patterns. Does anyone know of a way to do this? Otherwise I'll > > > install my own local proxy instance and configure it to redirect the > > > requests as necessary. > > > > > > Stuart > > > > > > > > > On 14.10.2016 15:13, Ivan Rancati wrote: > > > > > >> hi, > > >> No idea whether JMeter validates the hostname. I thought not, as I > have > > >> some tests that access the server by IP address, and the server > > >> certificate > > >> has a hostname. > > >> A couple of ideas to try to narrow down the problem > > >> > > >> - check jmeter.log > > >> You should see some INFO entries from jmeter.util.SSLManager, see if > > your > > >> keystore and aliases are loaded as expected. > > >> - java keytool problems > > >> I once could not get the keytool to work (it might have been a OpenJDK > > on > > >> Linux issue, I did not get around to try with Oracle JDK); I exported > > >> certificate/key to a .p12 file instead and it worked. > > >> > > >> Btw, for quicker troubleshooting, you can also pass all the SSL > options > > >> directly from the command line, as opposite to editing > > jmeter.properties, > > >> i.e. > > >> -Djavax.net.ssl.keyStoreType=PKCS12 > > >> > > >> hope this helps > > >> Ivan > > >> > > >> On Fri, Oct 14, 2016 at 12:35 PM, Stuart Barlow < > > stuart.barlow@gmail.com> > > >> wrote: > > >> > > >> Hi > > >>> > > >>> In test environments self-signed certificates are common and they're > > not > > >>> always created in the right way. I'm trying to connect via HTTPS > > Request > > >>> to > > >>> a website that uses a self-signed cert where the hostname is not > > >>> correctly > > >>> set inside the cert. The CN field has a value like "test-web-cert" > and > > >>> that > > >>> cert is also used by two different domains. It's deployed for both > > >>> https://www.test1.thirdpartywebsite.com and > > >>> https://www.test2.thirdpartywe > > >>> bsite.com > > >>> > > >>> I can access these websites from a browser and can view the > certificate > > >>> this way. The browser is more forgiving than JMeter. I tried > exporting > > it > > >>> from the browser and importing into the truststore used by JMeter (I > > set > > >>> javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword in > > >>> system.properties) and also into the cacerts in my JRE lib/security > > >>> folder. > > >>> Both of these didn't work. > > >>> > > >>> I always see this in the Response Tab of a Results Tree: > > >>> > > >>> java.net.SocketTimeoutException: Read timed out > > >>> at java.net.SocketInputStream.socketRead0(Native Method) > > >>> at java.net.SocketInputStream.socketRead(SocketInputStream. > > java > > >>> :116) > > >>> at java.net.SocketInputStream.read(SocketInputStream.java: > 170) > > >>> at java.net.SocketInputStream.read(SocketInputStream.java: > 141) > > >>> at sun.security.ssl.InputRecord.readFully(InputRecord.java: > > 465) > > >>> at sun.security.ssl.InputRecord.read(InputRecord.java:503) > > >>> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl. > > >>> java:973) > > >>> at sun.security.ssl.SSLSocketImpl. > > performInitialHandshake(SSLSo > > >>> cketImpl.java:1375) > > >>> at sun.security.ssl.SSLSocketImpl.startHandshake( > > SSLSocketImpl. > > >>> java:1403) > > >>> at sun.security.ssl.SSLSocketImpl.startHandshake( > > SSLSocketImpl. > > >>> java:1387) > > >>> at org.apache.http.conn.ssl.SSLSocketFactory. > > createLayeredSocke > > >>> t(SSLSocketFactory.java:573) > > >>> at org.apache.http.conn.ssl.SSLSocketFactory. > > createLayeredSocke > > >>> t(SSLSocketFactory.java:447) > > >>> at org.apache.jmeter.protocol.http.sampler. > > LazySchemeSocketFact > > >>> ory.createLayeredSocket(LazySchemeSocketFactory.java:121) > > >>> at org.apache.http.impl.conn.DefaultClientConnectionOperato > r. > > >>> updateSecureConnection(DefaultClientConnectionOperator.java:219) > > >>> at org.apache.http.impl.conn.ManagedClientConnectionImpl. > > layerP > > >>> rotocol(ManagedClientConnectionImpl.java:421) > > >>> at org.apache.jmeter.protocol.http.sampler. > > MeasuringConnectionM > > >>> anager$MeasuredConnection.layerProtocol(MeasuringConnectionM > > >>> anager.java:152) > > >>> at org.apache.http.impl.client.DefaultRequestDirector. > > establish > > >>> Route(DefaultRequestDirector.java:815) > > >>> at org.apache.http.impl.client.DefaultRequestDirector. > > tryConnec > > >>> t(DefaultRequestDirector.java:616) > > >>> at org.apache.http.impl.client.DefaultRequestDirector. > > execute(D > > >>> efaultRequestDirector.java:447) > > >>> at org.apache.http.impl.client.AbstractHttpClient.doExecute( > > Abs > > >>> tractHttpClient.java:884) > > >>> at org.apache.http.impl.client.CloseableHttpClient.execute( > > Clos > > >>> eableHttpClient.java:82) > > >>> at org.apache.http.impl.client.CloseableHttpClient.execute( > > Clos > > >>> eableHttpClient.java:55) > > >>> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl. > > executeR > > >>> equest(HTTPHC4Impl.java:619) > > >>> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl. > sample( > > >>> HTTPHC4Impl.java:379) > > >>> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy. > > sam > > >>> ple(HTTPSamplerProxy.java:74) > > >>> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase. > > samp > > >>> le(HTTPSamplerBase.java:1146) > > >>> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase. > > samp > > >>> le(HTTPSamplerBase.java:1135) > > >>> at org.apache.jmeter.threads.JMeterThread. > > executeSamplePackage( > > >>> JMeterThread.java:465) > > >>> at org.apache.jmeter.threads.JMeterThread.processSampler( > > JMeter > > >>> Thread.java:410) > > >>> at org.apache.jmeter.threads.JMeterThread.run(JMeterThread. > > java > > >>> :241) > > >>> at java.lang.Thread.run(Thread.java:745) > > >>> > > >>> My theory at the moment is that the SSL handshake is dropped because > of > > >>> hostname validation. I'm trying to connect to > > >>> https://www.test1.thirdpartywebsite.com but the certificate contains > > >>> value test-web-cert. They don't match so the connection is dropped. > I'm > > >>> able to use curl with the -k option to retrieve the content if that's > > >>> relevant. > > >>> > > >>> Can anyone tell me if there is a way in JMeter to disable hostname > > >>> validation during SSL Handshake? > > >>> > > >>> > > >>> Thanks, > > >>> > > >>> Stuart > > >>> > > >>> > > >>> ------------------------------------------------------------ > --------- > > >>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > > >>> For additional commands, e-mail: user-help@jmeter.apache.org > > >>> > > >>> > > >>> > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > > > For additional commands, e-mail: user-help@jmeter.apache.org > > > > > > > > > --047d7b8748184abb8405407f2035--