protected JmxmpSslSupport getJmxSslSupport() { return new JmxmpSslSupport(this); }
public synchronized PrivateKey getJmxAccessKey() { PrivateKey key = jmxSupport.getConfig(UsesJmx.JMX_SSL_ACCESS_KEY); if (key!=null) return key; getJmxAccessCert(); return jmxSupport.getConfig(UsesJmx.JMX_SSL_ACCESS_KEY); }
try { FluentKeySigner signer = getBrooklynRootSigner(); KeyPair jmxAgentKey = SecureKeys.newKeyPair(); X509Certificate jmxAgentCert = signer.newCertificateFor("jmxmp-agent", jmxAgentKey); agentTrustStore.setCertificateEntry("brooklyn", getJmxAccessCert()); ByteArrayOutputStream agentTrustStoreBytes = new ByteArrayOutputStream(); agentTrustStore.store(agentTrustStoreBytes, "".toCharArray()); jmxSupport.getMachine().get().copyTo(new ByteArrayInputStream(agentKeyStoreBytes.toByteArray()), getJmxSslKeyStoreFilePath()); jmxSupport.getMachine().get().copyTo(new ByteArrayInputStream(agentTrustStoreBytes.toByteArray()), getJmxSslTrustStoreFilePath());
public void applyAgentJmxJavaSystemProperties(Builder<String, Object> result) { result. put(JmxmpAgent.USE_SSL_PROPERTY, true). put(JmxmpAgent.AUTHENTICATE_CLIENTS_PROPERTY, true). // the option below wants a jmxremote.password file; we use certs (above) to authenticate put("com.sun.management.jmxremote.authenticate", false); result. put(JmxmpAgent.JMXMP_KEYSTORE_FILE_PROPERTY, getJmxSslKeyStoreFilePath()). put(JmxmpAgent.JMXMP_TRUSTSTORE_FILE_PROPERTY, getJmxSslTrustStoreFilePath()); }
public synchronized Certificate getJmxAccessCert() { Certificate cert = jmxSupport.getConfig(UsesJmx.JMX_SSL_ACCESS_CERT); if (cert!=null) return cert; // TODO load from keyStoreUrl KeyPair jmxAccessKey = SecureKeys.newKeyPair(); X509Certificate jmxAccessCert = getBrooklynRootSigner().newCertificateFor("brooklyn-jmx-access", jmxAccessKey); jmxSupport.setConfig(UsesJmx.JMX_SSL_ACCESS_CERT, jmxAccessCert); jmxSupport.setConfig(UsesJmx.JMX_SSL_ACCESS_KEY, jmxAccessKey.getPrivate()); return jmxAccessCert; }
/** installs files needed for JMX, to the runDir given in constructor, assuming the runDir has been created */ public void install() { if (getJmxAgentMode()!=JmxAgentModes.NONE) { getMachine().get().copyTo(ResourceUtils.create(this).getResourceFromUrl( getJmxAgentJarUrl()), getJmxAgentJarDestinationFilePath()); } if (isSecure()) { getJmxSslSupport().install(); } }
getJmxSslSupport().applyAgentJmxJavaSystemProperties(result); } else { result.