Thread: [Mc4j-cvs] SF.net SVN: mc4j:[604] trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/ impl/jmx/conne
Brought to you by:
ghinkl
From: <jma...@us...> - 2009-07-15 16:41:56
|
Revision: 604 http://mc4j.svn.sourceforge.net/mc4j/?rev=604&view=rev Author: jmazzitelli Date: 2009-07-15 16:41:50 +0000 (Wed, 15 Jul 2009) Log Message: ----------- support secure connections to websphere Modified Paths: -------------- trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java Modified: trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java =================================================================== --- trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java 2009-07-14 20:26:21 UTC (rev 603) +++ trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java 2009-07-15 16:41:50 UTC (rev 604) @@ -116,7 +116,7 @@ Properties props = new Properties(); URI serverUrl = new URI(connectionSettings.getServerUrl()); - if (serverUrl.getScheme().equalsIgnoreCase("http")) { + if (serverUrl.getScheme().equalsIgnoreCase("http") || serverUrl.getScheme().equalsIgnoreCase("https")) { System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager"); //Security.addProvider(new sun.security.provider.Sun()); System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol"); @@ -129,11 +129,18 @@ getConstant(adminClientClass, "CONNECTOR_TYPE"), getConstant(adminClientClass, "CONNECTOR_TYPE_RMI")); } - props.setProperty( - getConstant(adminClientClass, "CONNECTOR_SECURITY_ENABLED"), "false"); + String username = connectionSettings.getPrincipal(); + String password = connectionSettings.getCredentials(); + boolean security = ((username != null) && (!"".equals(username))); + if (security) { + props.setProperty(getConstant(adminClientClass, "CONNECTOR_SECURITY_ENABLED"), "true"); + props.setProperty(getConstant(adminClientClass, "USERNAME"), username); + props.setProperty(getConstant(adminClientClass, "PASSWORD"), password); + } else { + props.setProperty(getConstant(adminClientClass, "CONNECTOR_SECURITY_ENABLED"), "false"); + } - props.put( getConstant(adminClientClass, "CONNECTOR_HOST"), serverUrl.getHost()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jma...@us...> - 2009-08-13 23:23:56
|
Revision: 614 http://mc4j.svn.sourceforge.net/mc4j/?rev=614&view=rev Author: jmazzitelli Date: 2009-08-13 23:23:46 +0000 (Thu, 13 Aug 2009) Log Message: ----------- do not set the javax.net.debug system property Modified Paths: -------------- trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java Modified: trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java =================================================================== --- trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java 2009-07-17 06:05:23 UTC (rev 613) +++ trunk/mc4j/modules/ems/src/ems-impl/org/mc4j/ems/impl/jmx/connection/support/providers/WebsphereConnectionProvider.java 2009-08-13 23:23:46 UTC (rev 614) @@ -117,7 +117,7 @@ URI serverUrl = new URI(connectionSettings.getServerUrl()); if (serverUrl.getScheme().equalsIgnoreCase("http") || serverUrl.getScheme().equalsIgnoreCase("https")) { - System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager"); + //System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager"); //Security.addProvider(new sun.security.provider.Sun()); System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol"); //System.setProperty("ssl.SocketFactory.provider", "javax.net.ssl.SSLSocketFactory"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |