You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Gaël LHEZ <gl...@glowria.fr> on 2006/05/22 16:47:53 UTC

Disabling a SSL protocol in jMeter ?

I finally found why my test does not run with https server :

This is due to the server, java, and client authentification : I do not own
a certificate, nor I want to.

I ran a sample socket test, to check that :


    SSLSocket socket = (SSLSocket)
SSLSocketFactory.getDefault().createSocket(
        HTTPS_SERVER.substring("https://".length()), 443);
//    socket.setEnabledProtocols(new String[] {
//      "SSLv3"
//    });
    socket.startHandshake();
    socket.getOutputStream().write("GET /
HTTP/1.0\r\n\r\n".getBytes("ASCII"));
    Scanner sc = new Scanner(socket.getInputStream());
    System.out.println(">>>");
    while (sc.hasNextLine())
      System.out.println(sc.nextLine());
    System.out.println("<<<");


That don't work untill I uncomment the commented lines.



Now, that I figured the problem, I'd like to fix it and I don't find any
proper way to disable TSL1.0 (which fails) :

Setting https.protocols won't help (tested, and failed)

Is there a way to specifiate that I want to use SSLv3, not TLS in jmeter?
(except from running deep into the code)



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Disabling a SSL protocol in jMeter ?

Posted by sebb <se...@gmail.com>.
Perhaps the code

System.setProperty("ssl.SocketFactory.provider",
"com.glowria.https.SSLv3SocketFactory");

was being invoked a bit too late.

S.

On 23/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> Well
>
> Adding  -Dhttps.protocols=SSLv3
> -Dssl.SocketFactory.provider=com.glowria.https.SSLv3SocketFactory in
> jmeter.bat seems to work
>
> Finally, I may continue my work :)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Disabling a SSL protocol in jMeter ?

Posted by Gaël LHEZ <gl...@glowria.fr>.
Well

Adding  -Dhttps.protocols=SSLv3
-Dssl.SocketFactory.provider=com.glowria.https.SSLv3SocketFactory in
jmeter.bat seems to work

Finally, I may continue my work :)



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Disabling a SSL protocol in jMeter ?

Posted by Gaël LHEZ <gl...@glowria.fr>.
> Might be worth looking at the HTTP Client contributed code section on the
Apache website - 
> I think they have some examples of SSL and Socket Factory.

Mines working when I set it by the hand.

Doing this :

System.setProperty("ssl.SocketFactory.provider",
"com.glowria.https.SSLv3SocketFactory");

Should set up my factory, but that don't work while in jMeter

My test use HTTPClient, SSLSocket (directly), and finally
URL.openConnection() (which use URLConnection, and HTTPUrlConnection)

My factory is the following (that is just a facade to the real factory). I
don't know what is done in jMeter, but it seems to completly ignore my
factory.

package com.glowria.https;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

import com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl;

public class SSLv3SocketFactory extends SSLSocketFactory {
  private final static String[] enabledProtocols = {
      "SSLv3", "SSLv2Hello"
  };
  private final SSLSocketFactoryImpl impl = new SSLSocketFactoryImpl();

  
  private final Socket setUp(Socket sock) {
    ((SSLSocket) sock).setEnabledProtocols(enabledProtocols);
    return sock;
  }

  @Override
  public Socket createSocket() {
    return setUp(impl.createSocket());
  }

  @Override
  public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2,
      int arg3) throws IOException {
    return setUp(impl.createSocket(arg0, arg1, arg2, arg3));
  }

  @Override
  public Socket createSocket(InetAddress arg0, int arg1) throws IOException
{
    return setUp(impl.createSocket(arg0, arg1));
  }

  @Override
  public Socket createSocket(Socket arg0, String arg1, int arg2, boolean
arg3)
      throws IOException {
    return setUp(impl.createSocket(arg0, arg1, arg2, arg3));
  }

  @Override
  public Socket createSocket(String arg0, int arg1, InetAddress arg2, int
arg3)
      throws IOException {
    return setUp(impl.createSocket(arg0, arg1, arg2, arg3));
  }

  @Override
  public Socket createSocket(String arg0, int arg1) throws IOException,
      UnknownHostException {
    return setUp(impl.createSocket(arg0, arg1));
  }

  @Override
  public boolean equals(Object obj) {
    return impl.equals(obj);
  }

  @Override
  public String[] getDefaultCipherSuites() {
    return impl.getDefaultCipherSuites();
  }

  @Override
  public String[] getSupportedCipherSuites() {
    return impl.getSupportedCipherSuites();
  }

  @Override
  public int hashCode() {
    return impl.hashCode();
  }

  @Override
  public String toString() {
    return getClass().getName().toString() + "(" + impl.toString() +")";
  }

}







---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Disabling a SSL protocol in jMeter ?

Posted by sebb <se...@gmail.com>.
Might be worth looking at the HTTP Client contributed code section on
the Apache website - I think they have some examples of SSL and Socket
Factory.

On 23/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> Well,
>
> I'm trying to override JsseSSLManager so that it use appropriate protocol.
>
> Will see if it works
>
> -----Message d'origine-----
> De : sebb [mailto:sebbaz@gmail.com]
> Envoyé : mardi 23 mai 2006 11:37
> À : JMeter Users List
> Objet : Re: Disabling a SSL protocol in jMeter ?
>
> Sorry, you're right, my bad.
>
> But if there is a way to tell the default Socket Factory to use SSLv3 rather
> than TLS, you could use that approach. Or you could register your own
> SocketFactory.
>
> S.
> On 23/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> > Well
> >
> > The problem using such method is about how you create the socket.
> >
> > I have to create a socket once per each https request (or the HTTP
> > Sampler config element allow me to do so? What I mean is: how many
> > socket will I create/have for the entire test? One per each thread ?).
> >
> > I had the following Idea : make a Socket factory, which delegate to
> > the default socket factory the creation of socket, then I call
> > setEnabledProtocols to disable TLS1.0.
> >
> >
> >
> > -----Message d'origine-----
> > De : sebb [mailto:sebbaz@gmail.com]
> > Envoyé : lundi 22 mai 2006 20:02
> > À : JMeter Users List
> > Objet : Re: Disabling a SSL protocol in jMeter ?
> >
> > You might be able to do this in a BeanShell test element, as this
> > allow you to run arbitrary Java code.
> >
> > ------- snip -----------
> > import javax.net.ssl.SSLSocket;
> > import javax.net.ssl.SSLSocketFactory;
> >
> > String HTTPS_SERVER = ""; // Not sure what this is supposed to be
> >
> > print("Setting SSLv3");
> >
> > SSLSocket socket = (SSLSocket)
> >     SSLSocketFactory.getDefault().createSocket(
> >         HTTPS_SERVER.substring("https://".length()), 443);
> >
> > socket.setEnabledProtocols(new String[] {"SSLv3"});
> >
> > print("Finished setting SSLv3");
> >
> > --------- snip ------------------
> >
> > Put this in a BeanSHell sampler, in a separate Thread Group, and run
> > the sample once. Then run the rest of the test.
> >
> > Or you could put the code in an initialisation file, in which case you
> > just need to ensure that the BeanShell element is called at least once
> > before the rest of the test.
> >
> > The code could perhaps be added as an option for JMeter (e.g. via  a
> > property); feel free to create a Bugzilla enhancement request.
> >
> > S.
> > On 22/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> > > I finally found why my test does not run with https server :
> > >
> > > This is due to the server, java, and client authentification : I do
> > > not own a certificate, nor I want to.
> > >
> > > I ran a sample socket test, to check that :
> > >
> > >
> > >    SSLSocket socket = (SSLSocket)
> > > SSLSocketFactory.getDefault().createSocket(
> > >        HTTPS_SERVER.substring("https://".length()), 443);
> > > //    socket.setEnabledProtocols(new String[] {
> > > //      "SSLv3"
> > > //    });
> > >    socket.startHandshake();
> > >    socket.getOutputStream().write("GET /
> > > HTTP/1.0\r\n\r\n".getBytes("ASCII"));
> > >    Scanner sc = new Scanner(socket.getInputStream());
> > >    System.out.println(">>>");
> > >    while (sc.hasNextLine())
> > >      System.out.println(sc.nextLine());
> > >    System.out.println("<<<");
> > >
> > >
> > > That don't work untill I uncomment the commented lines.
> > >
> > >
> > >
> > > Now, that I figured the problem, I'd like to fix it and I don't find
> > > any proper way to disable TSL1.0 (which fails) :
> > >
> > > Setting https.protocols won't help (tested, and failed)
> > >
> > > Is there a way to specifiate that I want to use SSLv3, not TLS in
> jmeter?
> > > (except from running deep into the code)
> > >
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date:
> > 22/05/2006
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/2006
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Disabling a SSL protocol in jMeter ?

Posted by Gaël LHEZ <gl...@glowria.fr>.
Well,

I'm trying to override JsseSSLManager so that it use appropriate protocol.

Will see if it works 

-----Message d'origine-----
De : sebb [mailto:sebbaz@gmail.com] 
Envoyé : mardi 23 mai 2006 11:37
À : JMeter Users List
Objet : Re: Disabling a SSL protocol in jMeter ?

Sorry, you're right, my bad.

But if there is a way to tell the default Socket Factory to use SSLv3 rather
than TLS, you could use that approach. Or you could register your own
SocketFactory.

S.
On 23/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> Well
>
> The problem using such method is about how you create the socket.
>
> I have to create a socket once per each https request (or the HTTP 
> Sampler config element allow me to do so? What I mean is: how many 
> socket will I create/have for the entire test? One per each thread ?).
>
> I had the following Idea : make a Socket factory, which delegate to 
> the default socket factory the creation of socket, then I call 
> setEnabledProtocols to disable TLS1.0.
>
>
>
> -----Message d'origine-----
> De : sebb [mailto:sebbaz@gmail.com]
> Envoyé : lundi 22 mai 2006 20:02
> À : JMeter Users List
> Objet : Re: Disabling a SSL protocol in jMeter ?
>
> You might be able to do this in a BeanShell test element, as this 
> allow you to run arbitrary Java code.
>
> ------- snip -----------
> import javax.net.ssl.SSLSocket;
> import javax.net.ssl.SSLSocketFactory;
>
> String HTTPS_SERVER = ""; // Not sure what this is supposed to be
>
> print("Setting SSLv3");
>
> SSLSocket socket = (SSLSocket)
>     SSLSocketFactory.getDefault().createSocket(
>         HTTPS_SERVER.substring("https://".length()), 443);
>
> socket.setEnabledProtocols(new String[] {"SSLv3"});
>
> print("Finished setting SSLv3");
>
> --------- snip ------------------
>
> Put this in a BeanSHell sampler, in a separate Thread Group, and run 
> the sample once. Then run the rest of the test.
>
> Or you could put the code in an initialisation file, in which case you 
> just need to ensure that the BeanShell element is called at least once 
> before the rest of the test.
>
> The code could perhaps be added as an option for JMeter (e.g. via  a 
> property); feel free to create a Bugzilla enhancement request.
>
> S.
> On 22/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> > I finally found why my test does not run with https server :
> >
> > This is due to the server, java, and client authentification : I do 
> > not own a certificate, nor I want to.
> >
> > I ran a sample socket test, to check that :
> >
> >
> >    SSLSocket socket = (SSLSocket)
> > SSLSocketFactory.getDefault().createSocket(
> >        HTTPS_SERVER.substring("https://".length()), 443);
> > //    socket.setEnabledProtocols(new String[] {
> > //      "SSLv3"
> > //    });
> >    socket.startHandshake();
> >    socket.getOutputStream().write("GET / 
> > HTTP/1.0\r\n\r\n".getBytes("ASCII"));
> >    Scanner sc = new Scanner(socket.getInputStream());
> >    System.out.println(">>>");
> >    while (sc.hasNextLine())
> >      System.out.println(sc.nextLine());
> >    System.out.println("<<<");
> >
> >
> > That don't work untill I uncomment the commented lines.
> >
> >
> >
> > Now, that I figured the problem, I'd like to fix it and I don't find 
> > any proper way to disable TSL1.0 (which fails) :
> >
> > Setting https.protocols won't help (tested, and failed)
> >
> > Is there a way to specifiate that I want to use SSLv3, not TLS in
jmeter?
> > (except from running deep into the code)
> >
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 
> 22/05/2006
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/2006
 


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Disabling a SSL protocol in jMeter ?

Posted by sebb <se...@gmail.com>.
Sorry, you're right, my bad.

But if there is a way to tell the default Socket Factory to use SSLv3
rather than TLS, you could use that approach. Or you could register
your own SocketFactory.

S.
On 23/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> Well
>
> The problem using such method is about how you create the socket.
>
> I have to create a socket once per each https request (or the HTTP Sampler
> config element allow me to do so? What I mean is: how many socket will I
> create/have for the entire test? One per each thread ?).
>
> I had the following Idea : make a Socket factory, which delegate to the
> default socket factory the creation of socket, then I call
> setEnabledProtocols to disable TLS1.0.
>
>
>
> -----Message d'origine-----
> De : sebb [mailto:sebbaz@gmail.com]
> Envoyé : lundi 22 mai 2006 20:02
> À : JMeter Users List
> Objet : Re: Disabling a SSL protocol in jMeter ?
>
> You might be able to do this in a BeanShell test element, as this allow you
> to run arbitrary Java code.
>
> ------- snip -----------
> import javax.net.ssl.SSLSocket;
> import javax.net.ssl.SSLSocketFactory;
>
> String HTTPS_SERVER = ""; // Not sure what this is supposed to be
>
> print("Setting SSLv3");
>
> SSLSocket socket = (SSLSocket)
>     SSLSocketFactory.getDefault().createSocket(
>         HTTPS_SERVER.substring("https://".length()), 443);
>
> socket.setEnabledProtocols(new String[] {"SSLv3"});
>
> print("Finished setting SSLv3");
>
> --------- snip ------------------
>
> Put this in a BeanSHell sampler, in a separate Thread Group, and run the
> sample once. Then run the rest of the test.
>
> Or you could put the code in an initialisation file, in which case you just
> need to ensure that the BeanShell element is called at least once before the
> rest of the test.
>
> The code could perhaps be added as an option for JMeter (e.g. via  a
> property); feel free to create a Bugzilla enhancement request.
>
> S.
> On 22/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> > I finally found why my test does not run with https server :
> >
> > This is due to the server, java, and client authentification : I do
> > not own a certificate, nor I want to.
> >
> > I ran a sample socket test, to check that :
> >
> >
> >    SSLSocket socket = (SSLSocket)
> > SSLSocketFactory.getDefault().createSocket(
> >        HTTPS_SERVER.substring("https://".length()), 443);
> > //    socket.setEnabledProtocols(new String[] {
> > //      "SSLv3"
> > //    });
> >    socket.startHandshake();
> >    socket.getOutputStream().write("GET /
> > HTTP/1.0\r\n\r\n".getBytes("ASCII"));
> >    Scanner sc = new Scanner(socket.getInputStream());
> >    System.out.println(">>>");
> >    while (sc.hasNextLine())
> >      System.out.println(sc.nextLine());
> >    System.out.println("<<<");
> >
> >
> > That don't work untill I uncomment the commented lines.
> >
> >
> >
> > Now, that I figured the problem, I'd like to fix it and I don't find
> > any proper way to disable TSL1.0 (which fails) :
> >
> > Setting https.protocols won't help (tested, and failed)
> >
> > Is there a way to specifiate that I want to use SSLv3, not TLS in jmeter?
> > (except from running deep into the code)
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/2006
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Disabling a SSL protocol in jMeter ?

Posted by Gaël LHEZ <gl...@glowria.fr>.
Well

The problem using such method is about how you create the socket.

I have to create a socket once per each https request (or the HTTP Sampler
config element allow me to do so? What I mean is: how many socket will I
create/have for the entire test? One per each thread ?). 

I had the following Idea : make a Socket factory, which delegate to the
default socket factory the creation of socket, then I call
setEnabledProtocols to disable TLS1.0.

 

-----Message d'origine-----
De : sebb [mailto:sebbaz@gmail.com] 
Envoyé : lundi 22 mai 2006 20:02
À : JMeter Users List
Objet : Re: Disabling a SSL protocol in jMeter ?

You might be able to do this in a BeanShell test element, as this allow you
to run arbitrary Java code.

------- snip -----------
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

String HTTPS_SERVER = ""; // Not sure what this is supposed to be

print("Setting SSLv3");

SSLSocket socket = (SSLSocket)
     SSLSocketFactory.getDefault().createSocket(
         HTTPS_SERVER.substring("https://".length()), 443);

socket.setEnabledProtocols(new String[] {"SSLv3"});

print("Finished setting SSLv3");

--------- snip ------------------

Put this in a BeanSHell sampler, in a separate Thread Group, and run the
sample once. Then run the rest of the test.

Or you could put the code in an initialisation file, in which case you just
need to ensure that the BeanShell element is called at least once before the
rest of the test.

The code could perhaps be added as an option for JMeter (e.g. via  a
property); feel free to create a Bugzilla enhancement request.

S.
On 22/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> I finally found why my test does not run with https server :
>
> This is due to the server, java, and client authentification : I do 
> not own a certificate, nor I want to.
>
> I ran a sample socket test, to check that :
>
>
>    SSLSocket socket = (SSLSocket)
> SSLSocketFactory.getDefault().createSocket(
>        HTTPS_SERVER.substring("https://".length()), 443);
> //    socket.setEnabledProtocols(new String[] {
> //      "SSLv3"
> //    });
>    socket.startHandshake();
>    socket.getOutputStream().write("GET / 
> HTTP/1.0\r\n\r\n".getBytes("ASCII"));
>    Scanner sc = new Scanner(socket.getInputStream());
>    System.out.println(">>>");
>    while (sc.hasNextLine())
>      System.out.println(sc.nextLine());
>    System.out.println("<<<");
>
>
> That don't work untill I uncomment the commented lines.
>
>
>
> Now, that I figured the problem, I'd like to fix it and I don't find 
> any proper way to disable TSL1.0 (which fails) :
>
> Setting https.protocols won't help (tested, and failed)
>
> Is there a way to specifiate that I want to use SSLv3, not TLS in jmeter?
> (except from running deep into the code)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/2006
 


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Disabling a SSL protocol in jMeter ?

Posted by sebb <se...@gmail.com>.
You might be able to do this in a BeanShell test element, as this
allow you to run arbitrary Java code.

------- snip -----------
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

String HTTPS_SERVER = ""; // Not sure what this is supposed to be

print("Setting SSLv3");

SSLSocket socket = (SSLSocket)
     SSLSocketFactory.getDefault().createSocket(
         HTTPS_SERVER.substring("https://".length()), 443);

socket.setEnabledProtocols(new String[] {"SSLv3"});

print("Finished setting SSLv3");

--------- snip ------------------

Put this in a BeanSHell sampler, in a separate Thread Group, and run
the sample once. Then run the rest of the test.

Or you could put the code in an initialisation file, in which case you
just need to ensure that the BeanShell element is called at least once
before the rest of the test.

The code could perhaps be added as an option for JMeter (e.g. via  a
property); feel free to create a Bugzilla enhancement request.

S.
On 22/05/06, Gaël LHEZ <gl...@glowria.fr> wrote:
> I finally found why my test does not run with https server :
>
> This is due to the server, java, and client authentification : I do not own
> a certificate, nor I want to.
>
> I ran a sample socket test, to check that :
>
>
>    SSLSocket socket = (SSLSocket)
> SSLSocketFactory.getDefault().createSocket(
>        HTTPS_SERVER.substring("https://".length()), 443);
> //    socket.setEnabledProtocols(new String[] {
> //      "SSLv3"
> //    });
>    socket.startHandshake();
>    socket.getOutputStream().write("GET /
> HTTP/1.0\r\n\r\n".getBytes("ASCII"));
>    Scanner sc = new Scanner(socket.getInputStream());
>    System.out.println(">>>");
>    while (sc.hasNextLine())
>      System.out.println(sc.nextLine());
>    System.out.println("<<<");
>
>
> That don't work untill I uncomment the commented lines.
>
>
>
> Now, that I figured the problem, I'd like to fix it and I don't find any
> proper way to disable TSL1.0 (which fails) :
>
> Setting https.protocols won't help (tested, and failed)
>
> Is there a way to specifiate that I want to use SSLv3, not TLS in jmeter?
> (except from running deep into the code)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org