监控WebSphere 6.1以及WAS6.1生成和配置安全证书的方法
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
Properties adminProps = new Properties();adminProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP);adminProps.setProperty(AdminClient.CONNECTOR_HOST, "localhost");adminProps.setProperty(AdminClient.CONNECTOR_PORT, "8880");adminProps.setProperty(AdminClient.USERNAME, "chenfeng");adminProps.setProperty(AdminClient.PASSWORD, "chenfeng");adminProps.setProperty(AdminClient.CACHE_DISABLED, "false");// WebSphere服务器是否已启用管理安全性adminProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");adminProps.setProperty(AdminClient.CONNECTOR_AUTO_ACCEPT_SIGNER, "true");adminProps.setProperty("javax.net.ssl.trustStore","D:/JavaTools/IBM/MyKey/trust.jks");adminProps.setProperty("javax.net.ssl.keyStore","D:/JavaTools/IBM/MyKey/store.jks");adminProps.setProperty("javax.net.ssl.trustStorePassword","chenfeng222");adminProps.setProperty("javax.net.ssl.keyStorePassword", "chenfeng111");AdminClient adminClient = AdminClientFactory.createAdminClient(adminProps);// 这里只是最简单了获取了domainNameString domainName = adminClient.getDomainName();
?
?
后记:终于搞定,转载这么一篇文章那叫一个累啊,二十多张图片,下载再上传,还要排版。不过值得!
?