简介
本文档帮助您排除与SunPKCS11-NSS相关的错误消息。当您在CloudCenter Manager(CCM)和CloudCenter Orchestrator(CCO)计算机中启动tomcat服务时,会出现此错误。
受影响版本
注意:此错误在4.7.1.1的新安装期间出现
问题
当您尝试配置CloudCenter时,用户可能会在osmosix.log中看到以下错误消息:
2017-05-20 20:07:15,153 ERROR config.GatewayConfigController [http-apr-8443-exec-8] - com.osmosix.commons.crypto.CryptoException: com.osmosix.commons.crypto.CryptoException: java.security.NoSuchProviderException: No such provider: SunPKCS11-NSS
java.lang.RuntimeException: com.osmosix.commons.crypto.CryptoException: com.osmosix.commons.crypto.CryptoException: java.security.NoSuchProviderException: No such provider: SunPKCS11-NSS
at com.osmosix.commons.convert.converter.CryptoJson2HttpMessageConverter.encrypt(CryptoJson2HttpMessageConverter.java:87
解决方案
此错误是由于未在Java 8中配置网络安全服务所致。通常由CloudCenter安装程序配置,但有一些实例缺少此配置。
如何在CloudCenter服务器上重新配置NSS:
转到此目录:
cd /usr/lib/jvm/java-8-sun/jre/lib/security
验证java.security配置:
cat java.security | grep security.provider
如果系统上配置了NSS,您应该会在security.provider.10中看到它,如下所示:
[root@localhost security]# cat java.security | grep security.provider
# security.provider.<n>=<className>
# named Sun appears in the sun.security.provider package. Thus, the
# security.provider.1=sun.security.provider.Sun
security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=sun.security.ec.SunEC
security.provider.4=com.sun.net.ssl.internal.ssl.Provider
security.provider.5=com.sun.crypto.provider.SunJCE
security.provider.6=sun.security.jgss.SunProvider
security.provider.7=com.sun.security.sasl.Provider
security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.9=sun.security.smartcardio.SunPCSC
security.provider.10=sun.security.pkcs11.SunPKCS11 /usr/lib/jvm/java-8-sun/jre/lib/security/nss.cfg
login.configuration.provider=sun.security.provider.ConfigFile
policy.provider=sun.security.provider.PolicyFile
如果缺少突出显示的行,请将其添加到java.security文件。
使用以下内容在同一目录中创建nss.cfg文件:
name = NSS
nssLibraryDirectory = /usr/lib64/
nssDbMode = noDb
attributes = compatibility
验证对java.security和nss.cfg文件的权限是否正确。权限应为644。
重新启动CloudCenter VM:
reboot
现在,您应该能够配置CloudCenter。