-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2243 from chathuranga-jayanath-99/integrate-only-…
…ssl-loader Handle certificates mentioned in HTTP connection during local entry deployment.
- Loading branch information
Showing
9 changed files
with
302 additions
and
5 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
26 changes: 26 additions & 0 deletions
26
...ttp/src/main/java/org/apache/synapse/transport/dynamicconfigurations/IKeyStoreLoader.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,26 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.synapse.transport.dynamicconfigurations; | ||
|
||
import org.apache.axis2.AxisFault; | ||
import org.apache.axis2.description.ParameterInclude; | ||
|
||
public interface IKeyStoreLoader { | ||
|
||
void loadKeyStore(ParameterInclude transport) throws AxisFault; | ||
} |
45 changes: 45 additions & 0 deletions
45
...tp/src/main/java/org/apache/synapse/transport/dynamicconfigurations/KeyStoreReloader.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,45 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.synapse.transport.dynamicconfigurations; | ||
|
||
import org.apache.axis2.AxisFault; | ||
import org.apache.axis2.description.ParameterInclude; | ||
|
||
public class KeyStoreReloader { | ||
|
||
private IKeyStoreLoader keyStoreLoader; | ||
private ParameterInclude transportOutDescription; | ||
|
||
public KeyStoreReloader(IKeyStoreLoader keyStoreLoader, ParameterInclude transportOutDescription) { | ||
|
||
this.keyStoreLoader = keyStoreLoader; | ||
this.transportOutDescription = transportOutDescription; | ||
|
||
registerListener(transportOutDescription); | ||
} | ||
|
||
private void registerListener(ParameterInclude transportOutDescription) { | ||
|
||
KeyStoreReloaderHolder.getInstance().addKeyStoreLoader(this); | ||
} | ||
|
||
public void update() throws AxisFault { | ||
|
||
keyStoreLoader.loadKeyStore(transportOutDescription); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
.../main/java/org/apache/synapse/transport/dynamicconfigurations/KeyStoreReloaderHolder.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,47 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.synapse.transport.dynamicconfigurations; | ||
|
||
import org.apache.axis2.AxisFault; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class KeyStoreReloaderHolder { | ||
|
||
private static KeyStoreReloaderHolder instance = new KeyStoreReloaderHolder(); | ||
private List<KeyStoreReloader> keyStoreLoaders; | ||
|
||
private KeyStoreReloaderHolder() { | ||
keyStoreLoaders = new ArrayList<>(); | ||
} | ||
|
||
public static KeyStoreReloaderHolder getInstance() { | ||
return instance; | ||
} | ||
|
||
public void addKeyStoreLoader(KeyStoreReloader keyStoreLoader) { | ||
keyStoreLoaders.add(keyStoreLoader); | ||
} | ||
|
||
public void reloadAllKeyStores() throws AxisFault { | ||
for (KeyStoreReloader keyStoreLoader : keyStoreLoaders) { | ||
keyStoreLoader.update(); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.