简体   繁体   English

使用自定义 SSL 配置启动 WebLogic 服务器

[英]Start WebLogic server with custom SSL config

Currently I'm experimenting a little bit with Oracle WebLogic Server 12c.目前我正在对 Oracle WebLogic Server 12c 进行一些试验。 I set up a new domain to experiment with SSL.我设置了一个新域来试验 SSL。 I've already created a custom identity store, certificate and trust following the instructions here: https://helpx.adobe.com/uk/experience-manager/6-3/forms/using/admin-help/configuring-ssl-weblogic-server.html#creating_an_ssl_credential_for_use_on_weblogic_server我已经按照此处的说明创建了自定义身份存储、证书和信任: https://helpx.adobe.com/uk/experience-manager/6-3/forms/using/admin-help/configuring-ssl- weblogic-server.html#creating_an_ssl_credential_for_use_on_weblogic_server

I've also set up my AdminServer to use these, which I could test by activating the domain wide admin port and connecting to the admin console.我还设置了我的 AdminServer 以使用这些,我可以通过激活域范围的管理端口并连接到管理控制台来进行测试。 I inspected the provided cert in the browser and could verify, that it was my custom cert.我在浏览器中检查了提供的证书并可以验证它是我的自定义证书。

So far so good.到目前为止,一切都很好。 But when I create a managed server, and configure it to also use my custom identity, trust and the certificate and save the settings in the admin console, I'm not able to boot the server using the provided startManagedWebLogic.sh script.但是,当我创建托管服务器并将其配置为也使用我的自定义身份、信任和证书并将设置保存在管理控制台中时,我无法使用提供的 startManagedWebLogic.sh 脚本启动服务器。 The reason for the failure is, that the server tries to use the DemoCert and DemoTrust, as I can see in the logs.失败的原因是,服务器尝试使用 DemoCert 和 DemoTrust,正如我在日志中看到的那样。 Consequently it fails to connect to the AdminServer and cannot load it's configs.因此它无法连接到 AdminServer 并且无法加载它的配置。

Here is my problem: How should I start a managed server with custom SSL settings, if the default settings are always used to start it up in the first place?这是我的问题:如果始终使用默认设置启动托管服务器,我应该如何使用自定义 SSL 设置启动托管服务器? Is there any way, to modify the startup scripts to use different defaults?有什么办法可以修改启动脚本以使用不同的默认值? Or is there a different "best practice"?还是有不同的“最佳实践”?

The error for the server not starting up are:服务器未启动的错误是:

<Apr 6, 2020 2:40:46,041 PM CEST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: A MultiException has 6 exceptions.  They are:
1. weblogic.security.SecurityInitializationException: Authentication for user weblogic denied.
2. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.security.SecurityService
3. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.jndi.internal.RemoteNamingService errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.jndi.internal.RemoteNamingService
5. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.io.common.internal.FileService errors were found
6. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.io.common.internal.FileService

A MultiException has 6 exceptions.  They are:
1. weblogic.security.SecurityInitializationException: Authentication for user weblogic denied.
2. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.security.SecurityService
3. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.jndi.internal.RemoteNamingService errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.jndi.internal.RemoteNamingService
5. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.io.common.internal.FileService errors were found
6. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.io.common.internal.FileService

    at org.jvnet.hk2.internal.Collector.throwIfErrors(Collector.java:89)
    at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:250)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:305)
    Truncated. see log file for complete stacktrace
Caused By: weblogic.security.SecurityInitializationException: Authentication for user weblogic denied.
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:1158)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.postInitialize(CommonSecurityServiceManagerDelegateImpl.java:1272)
    at weblogic.security.service.SecurityServiceManager.postInitialize(SecurityServiceManager.java:586)
    at weblogic.security.SecurityService.start(SecurityService.java:130)
    at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:76)
    Truncated. see log file for complete stacktrace
Caused By: javax.security.auth.login.FailedLoginException: [Security:090938]Authentication failure: The specified user failed to log in. weblogic.security.providers.authentication.LDAPAtnDelegateException: [Security:090295]caught unexpected exception, No such object
    at com.bea.common.security.utils.ExceptionHandler.throwFailedLoginException(ExceptionHandler.java:62)
    at weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.login(LDAPAtnLoginModuleImpl.java:369)
    at com.bea.common.security.internal.service.LoginModuleWrapper$1.run(LoginModuleWrapper.java:117)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.bea.common.security.internal.service.LoginModuleWrapper.login(LoginModuleWrapper.java:114)
    Truncated. see log file for complete stacktrace
>

I've checked username and password, they have been entered correctly.我检查了用户名和密码,它们输入正确。

EDIT: If I disable the admin port, and startup the managed server with编辑:如果我禁用管理端口,并启动托管服务器

startManagedWeblogic ms0 t3://localhost:7001 (1)

instead of代替

startManagedWeblogic ms0 t3s://localhost:9001 (2)

the server starts up as intended.服务器按预期启动。 Consecutive startups with ENABLED admin port (2) do succeed in spite of the persistent problems when trying to reach the admin server during startup.尽管在启动期间尝试访问管理服务器时存在持续问题,但使用 ENABLED 管理端口 (2) 的连续启动确实成功。

EDIT 2: I've tried using NodeManager for that, thanks to the reply below.编辑2:感谢下面的回复,我已经尝试使用NodeManager。 Unfortunately, I cannot access it from the admin console, due to an SSL exception:不幸的是,由于 SSL 异常,我无法从管理控制台访问它:

javax.net.ssl.SSLHandshakeException

I found out, that I have to configure the Nodemanager to also use custom ssl settings in the nodemanager.properties file.我发现,我必须将 Nodemanager 配置为还使用 nodemanager.properties 文件中的自定义 ssl 设置。 I used the following settings:我使用了以下设置:

## SSL ##
# Configure default SSL
KeyStores=CustomIdentityAndCustomTrust

# Identity keystore
CustomIdentityKeyStoreFileName=/home/iffuw/feck-credentials.jks
CustomIdentityKeyStoreType=jks
CustomIdentityKeyStorePassPhrase=whatever

# private key
CustomIdentityAlias=feck-credentials
CustomIdentityPrivateKeyPassPhrase=whatever

# Trust keystore
CustomTrustKeyStoreFileName=/home/iffuw/feck-ca.jks
CustomTrustKeyStoreType=jks
CustomTrustKeyPassPhrase=whatever
CustomTrustKeyStorePassPhrase=whatever

Please note, that the passphrases are not all whatever, but the passphrases for the two KeyStores (Id and Trust) are identical.请注意,密码不是全部,但两个 KeyStore(Id 和 Trust)的密码是相同的。 When I start up nodemanger, the passphrases from the key and identity blocks are encrypted.当我启动 nodemanger 时,来自密钥和身份块的密码被加密。 The passphrase from the trust block turn out to be empty.来自信任块的密码被证明是空的。 Something might go wrong here, but I don't know what.这里可能有 go 错误,但我不知道是什么。 Any ideas?有任何想法吗? The nodemanager.log says: nodemanager.log 说:

<Apr 6, 2020 4:30:40 PM CEST> <INFO> <Upgrade> <Removing NodeManager property: CustomTrustKeyStorePassPhrase>

is that normal?这正常吗?

in the script startManagedWebLogic.sh you need to set the parameter:在脚本 startManagedWebLogic.sh 中您需要设置参数:

-Djavax.net.ssl.trustStore=/YOUR_PATH/CustomTrust.jks 

More useful (example) SSL/JKS parameters:更有用的(示例)SSL/JKS 参数:

-Djavax.net.debug=ssl
-Djavax.net.ssl.keyStoreType=pkcs12
-Djavax.net.ssl.keyStore=client.p12
-Djavax.net.ssl.keyStorePassword=whatever
-Djavax.net.ssl.trustStoreType=jks
-Djavax.net.ssl.trustStore=client-truststore.jks
-Djavax.net.ssl.trustStorePassword=whatever

In the other hand, this can be avoided if you start up the managed server through admin console (actually it is node manager underneath working).另一方面,如果您通过管理控制台启动托管服务器(实际上它是在工作的节点管理器),则可以避免这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM