|
From: Bob K. <bob...@us...> - 2004-07-20 08:13:38
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20727 Modified Files: Http.java Log Message: Fix the bug on SSL based on suggestions by Mattias J Index: Http.java =================================================================== RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport/Http.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Http.java 15 Dec 2003 09:51:35 -0000 1.12 --- Http.java 20 Jul 2004 08:13:28 -0000 1.13 *************** *** 137,140 **** --- 137,146 ---- //private static SSLSocketFactory sslSocketFactory; public static void configure(Property prop) throws InitializationException { + String pkgs = System.getProperty(PROTOCOL_HANDLER_PKGS); + if (pkgs == null || pkgs.indexOf(SSL_WWW_PROTOCOL) < 0 ) { + pkgs = (pkgs == null ? SSL_WWW_PROTOCOL : + SSL_WWW_PROTOCOL + "|" + pkgs); + System.setProperty(PROTOCOL_HANDLER_PKGS, pkgs); + } String s = prop.get(Constants.PROPERTY_CONTENT_TRANSFER_ENCODING); if (s != null && !s.equals("")) { *************** *** 183,188 **** --- 189,196 ---- File realTrustStoreFile = new File(trustedStorePath + File.separator + trustedStoreFile); + /* TrustManager[] trustManagers = null; KeyManager[] keyManagers = null; + */ if (realTrustStoreFile.exists() && realTrustStoreFile.isFile()) { logger.debug("Use SSL trusted keystore : " + realTrustStoreFile); *************** *** 367,370 **** --- 375,379 ---- try { URL url = new URL(toUrl); + /* if (url.getProtocol().equalsIgnoreCase (Constants.TRANSPORT_TYPE_HTTPS)) { *************** *** 376,379 **** --- 385,389 ---- } } + */ HttpURLConnection connection = (HttpURLConnection) url.openConnection(); |