ASF Bugzilla – Attachment 30133 Details for
Bug 54759
SSLPeerUnverifiedException using HTTPS , property documented
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test showing failure with Java API
DevWrapper.java (text/plain), 1.90 KB, created by
Philippe Mouawad
on 2013-04-01 20:34:22 UTC
(
hide
)
Description:
Test showing failure with Java API
Filename:
MIME Type:
Creator:
Philippe Mouawad
Created:
2013-04-01 20:34:22 UTC
Size:
1.90 KB
patch
obsolete
>/** > * > */ >package org.apache.jmeter; > >import java.io.IOException; >import java.net.MalformedURLException; >import java.net.URL; >import java.security.KeyManagementException; >import java.security.NoSuchAlgorithmException; >import java.security.cert.CertificateException; >import java.security.cert.X509Certificate; > >import javax.net.ssl.HostnameVerifier; >import javax.net.ssl.HttpsURLConnection; >import javax.net.ssl.SSLContext; >import javax.net.ssl.SSLSession; >import javax.net.ssl.TrustManager; >import javax.net.ssl.X509TrustManager; > >/** > * @author philippemouawad > * > */ >public class DevWrapper { > > /** > * @param args > */ > public static void main(String[] args) throws NoSuchAlgorithmException, > KeyManagementException, MalformedURLException, IOException { > X509TrustManager tm = new X509TrustManager() { > @Override > public X509Certificate[] getAcceptedIssuers() { > return null; > } > > @Override > public void checkServerTrusted( > X509Certificate[] paramArrayOfX509Certificate, > String paramString) throws CertificateException { > > } > > @Override > public void checkClientTrusted( > X509Certificate[] paramArrayOfX509Certificate, > String paramString) throws CertificateException { > } > }; > SSLContext ctx = SSLContext.getInstance("TLS"); > ctx.init(null, new TrustManager[] { tm }, null); > SSLContext.setDefault(ctx); > HttpsURLConnection conn = (HttpsURLConnection) new URL( > "https://clui.xstratacoal.com.au").openConnection(); > conn.setHostnameVerifier(new HostnameVerifier() { > > @Override > public boolean verify(String paramString, SSLSession paramSSLSession) { > return true; > } > }); > conn.connect(); > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 54759
:
30109
|
30132
| 30133