Changeset 5233 for branches/OKBJavaConnector
- Timestamp:
- 01/07/11 18:34:30 (14 years ago)
- Location:
- branches/OKBJavaConnector/HLOKBWebClient/src/main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/wsclient/OKBServiceClient.java
r5229 r5233 3 3 import static at.hl.okb.wsclient.Utilities.createNameFilter; 4 4 5 import java.security.KeyManagementException; 6 import java.security.NoSuchAlgorithmException; 5 7 import java.util.ArrayList; 6 8 import java.util.HashMap; … … 8 10 import java.util.Map; 9 11 10 import javax. xml.bind.JAXBElement;11 import javax. xml.namespace.QName;12 13 import com.google.common.collect.Iterables;12 import javax.net.ssl.HttpsURLConnection; 13 import javax.net.ssl.SSLContext; 14 import javax.net.ssl.TrustManager; 15 import javax.net.ssl.X509TrustManager; 14 16 15 17 import at.hl.wsclient.okb.Algorithm; … … 17 19 import at.hl.wsclient.okb.ArrayOfAlgorithm; 18 20 import at.hl.wsclient.okb.ArrayOfAlgorithmParameter; 19 import at.hl.wsclient.okb.ArrayOfPlatform;20 21 import at.hl.wsclient.okb.ArrayOfProblem; 21 22 import at.hl.wsclient.okb.IOKBService; … … 25 26 import at.hl.wsclient.okb.Problem; 26 27 28 import com.google.common.collect.Iterables; 29 27 30 public class OKBServiceClient { 28 31 OKBService srv = null; 29 32 IOKBService port = null; 30 33 34 // hack for allowing self signed certificates 35 static { 36 // Create a trust manager that does not validate certificate chains 37 TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { 38 public java.security.cert.X509Certificate[] getAcceptedIssuers() { 39 return new java.security.cert.X509Certificate[] {}; 40 } 41 42 public void checkClientTrusted( 43 java.security.cert.X509Certificate[] certs, String authType) { 44 } 45 46 public void checkServerTrusted( 47 java.security.cert.X509Certificate[] certs, String authType) { 48 } 49 } }; 50 51 SSLContext sc; 52 try { 53 sc = SSLContext.getInstance("SSL"); 54 sc.init(null, trustAllCerts, new java.security.SecureRandom()); 55 HttpsURLConnection 56 .setDefaultSSLSocketFactory(sc.getSocketFactory()); 57 } catch (NoSuchAlgorithmException e) { 58 throw new RuntimeException(e); 59 } catch (KeyManagementException e) { 60 throw new RuntimeException(e); 61 } 62 63 } 64 31 65 public OKBServiceClient() { 32 66 this.srv = new OKBService(); 33 this.port = srv.getWSHttpBindingIOKBService ();67 this.port = srv.getWSHttpBindingIOKBService1(); 34 68 } 35 69 … … 48 82 49 83 private void createPlatform(String name) { 50 84 51 85 ObjectFactory factory = new ObjectFactory(); 52 86 Platform platform = factory.createPlatform(); 53 87 54 88 platform.setName(factory.createNamedOKBItemName(name)); 55 89 port.addPlatform(platform); -
branches/OKBJavaConnector/HLOKBWebClient/src/main/resources/OKBService.xml
r4955 r5233 2053 2053 <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> 2054 2054 <X509Data> 2055 <X509Certificate>MIIB7jCCAVugAwIBAgIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEwMDgxNzE2MTFaFw0zOTEyMzEyMzU5NTlaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzU+W3f1o9F66BJYnw2RwOfPBWYIUsz3B2A1mNbI7a6kjJmR8qKp/bi5dN6SJxOE0HRSpRXtebU2dvPR78haVgvBSAGVc7FNFpzC7vd64qIcTiUnWz6r7Z4tb11IC8HSyFg/XBUAxEJUB88zOi1uSvf5CAnPDdSEhjF67tPEeFDkCAwEAAaNJMEcwRQYDVR0BBD4wPIAQ5KbnDDhtrCbHXkz79n0QA6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAA4GBAC2A/h0HV1CUKqB9x2wxGE4Vjx8K8Xad4zcYNiXC/TxE09jMVJlN2k0OeBWM6Y4bhkxwtFfP0ZTH/4sIv+6h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CWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuLYzZApEB/L9S7GWjvERJabg85yL3hZttvQNmBss2vQdE8cJnn9fBTKo8itl0XkGDGtY5Iz3zsR8fsqL7cNCUnMl/c+C5CNz7vYa8U7xf38q6udFx1NL7EMR9V1SfTyCXkOqiMb2NqX6yw1Rq9QYe+VnVL5k3hZtoLuyKAPuJk0CAwEAAaNJMEcwRQYDVR0BBD4wPIAQMzdxtx7LYu7RVs3k80vXj6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQ0meBmhk5CIFPO5UnHjhOUjAJBgUrDgMCHQUAA4GBACItYyuXIJJdA32tI8q8kxolwhWZHeJ1wSkoqhU8zOJQTIHS2gFjNgHC8gPQhoV9g9hZ9WGj07F9/VL6F9ziKbXLaYtXv8lzoYOD5iodF8/35Ew4O9tbwFXrNbZBQqk7ZrZF9G15aAH408zoMc/quURFzQKkBa3Z9Apz/l36ewtb 2076 </X509Certificate>--> 2073 2077 </X509Data> 2074 2078 </KeyInfo> … … 2082 2086 <sc:CallbackHandlerConfiguration 2083 2087 wspp:visibility="private"> 2084 <sc:CallbackHandler default=" MartinH" name="usernameHandler" />2085 <sc:CallbackHandler default=" mh2404" name="passwordHandler" />2088 <sc:CallbackHandler default="fab" name="usernameHandler" /> 2089 <sc:CallbackHandler default="fab123" name="passwordHandler" /> 2086 2090 </sc:CallbackHandlerConfiguration> 2087 2091
Note: See TracChangeset
for help on using the changeset viewer.