提交 d3791e9a 编写于 作者: J Jesse Glick

Check for null return values from InstanceIdentityProvider methods.

上级 074adc36
......@@ -101,7 +101,13 @@ public class JnlpSlaveAgentProtocol4 extends AgentProtocol {
public JnlpSlaveAgentProtocol4() throws KeyStoreException, KeyManagementException, IOException {
// prepare our local identity and certificate
X509Certificate identityCertificate = InstanceIdentityProvider.RSA.getCertificate();
if (identityCertificate == null) {
throw new KeyStoreException("no X509Certificate found; perhaps instance-identity is missing or too old");
}
RSAPrivateKey privateKey = InstanceIdentityProvider.RSA.getPrivateKey();
if (privateKey == null) {
throw new KeyStoreException("no RSAPrivateKey found; perhaps instance-identity is missing or too old");
}
// prepare our keyStore so we can provide our authentication
keyStore = KeyStore.getInstance("JKS");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册