jclouds:创建 BlobStoreContext 时如何提供自己的 KeyStore
我有一个带有自签名证书的私人 blob 存储(swift)。
我想将这个商店与 jclouds 一起使用。现在,以下内容有效:
Properties overrides = new Properties();
overrides.setProperty(Constants.PROPERTY_ENDPOINT, "https://example.com:8080/auth");
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
BlobStoreContext context = new BlobStoreContextFactory().createContext("swift",
userCredentials.getIdent(), userCredentials.getSecret(),
ImmutableSet.<Module> of(), overrides);
但是,由于我有证书,有没有办法使其更安全并告诉 jclouds 使用该特定证书而不是信任任何证书?
我确实知道如何将证书加载到 Certificate
对象中,并且我还知道如何使用证书创建 KeyStore
对象。
我的问题是:如何让 jclouds 使用我的 Certificate
或 KeyStore
进行证书验证?
I have a private blob store (swift) with a self-signed certificate.
I want to use this store with jclouds. Now, the following works:
Properties overrides = new Properties();
overrides.setProperty(Constants.PROPERTY_ENDPOINT, "https://example.com:8080/auth");
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
BlobStoreContext context = new BlobStoreContextFactory().createContext("swift",
userCredentials.getIdent(), userCredentials.getSecret(),
ImmutableSet.<Module> of(), overrides);
However, since I have the certificate, is there a way to make this more secure and tell jclouds to use that particular certificate rather than trust any?
I do know how to get the certificate loaded into a Certificate
object and I also know how to create a KeyStore
object with the certificate.
My question is: How do I get jclouds to use my Certificate
or KeyStore
for certificate validation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前,jclouds 不提供此挂钩,因此您必须修改 JRE 密钥库。请随时在此处添加功能请求:http://code.google.com/ p/jclouds/问题/条目
Right now, jclouds doesn't provide this hook, so you'd have to modify the JRE keystore. feel free to add a feature request for this here: http://code.google.com/p/jclouds/issues/entry
正如 Adrian 在 jclouds-user maillist 上向我指出的那样,现在可以通过添加如下模块来实现:
As Adrian pointed out to me on jclouds-user maillist, it is possible now, by adding a module like this: