-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WFCORE-6755] Move the org.wildfly.security:wildfly-elytron-dynamic-s…
…sl artifact into its own module
- Loading branch information
Showing
6 changed files
with
64 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...urces/modules/system/layers/base/org/wildfly/security/elytron-dynamic-ssl/main/module.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
~ Copyright The WildFly Authors | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<module xmlns="urn:jboss:module:1.9" name="org.wildfly.security.elytron-dynamic-ssl"> | ||
|
||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
|
||
<resources> | ||
<artifact name="${org.wildfly.security:wildfly-elytron-dynamic-ssl}"/> | ||
</resources> | ||
|
||
<dependencies> | ||
<module name="java.logging"/> | ||
<module name="org.jboss.logging" /> | ||
<module name="org.jboss.logmanager" /> | ||
<module name="org.wildfly.security.elytron-base" services="import" export="true"/> | ||
<module name="org.wildfly.common" export="true"/> | ||
<module name="org.wildfly.client.config" export="true"/> | ||
</dependencies> | ||
</module> |
34 changes: 34 additions & 0 deletions
34
elytron/src/main/java/org/wildfly/extension/elytron/DynamicSSLContextHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.wildfly.extension.elytron; | ||
|
||
import org.wildfly.security.auth.client.AuthenticationContext; | ||
import org.wildfly.security.dynamic.ssl.DynamicSSLContext; | ||
import org.wildfly.security.dynamic.ssl.DynamicSSLContextImpl; | ||
import org.wildfly.security.dynamic.ssl.DynamicSSLContextException; | ||
|
||
import javax.net.ssl.SSLContext; | ||
import java.security.GeneralSecurityException; | ||
import static org.wildfly.extension.elytron._private.ElytronSubsystemMessages.ROOT_LOGGER; | ||
|
||
/** | ||
* Helper class for obtaining an instance of DynamicSSLContext created from the provided AuthenticationContext | ||
*/ | ||
class DynamicSSLContextHelper { | ||
|
||
/** | ||
* Get DynamicSSLContext instance from the provided authentication context | ||
* @param authenticationContext authentication context to use with the DynamicSSLContext | ||
* @return DynamicSSLContext instance | ||
*/ | ||
static SSLContext getDynamicSSLContextInstance(AuthenticationContext authenticationContext) { | ||
try { | ||
return new DynamicSSLContext(new DynamicSSLContextImpl(authenticationContext)); | ||
} catch (DynamicSSLContextException | GeneralSecurityException e) { | ||
throw ROOT_LOGGER.unableToObtainDynamicSSLContext(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters