-
Notifications
You must be signed in to change notification settings - Fork 69
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 #1673 from jbellmann/feature/sslbundles_support
Make it possible to use spring-boots ssl-bundle support
- Loading branch information
Showing
14 changed files
with
417 additions
and
6 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
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
31 changes: 31 additions & 0 deletions
31
...n/java/org/zalando/riptide/autoconfigure/SslBundleUsageOrCertificatePinningException.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,31 @@ | ||
package org.zalando.riptide.autoconfigure; | ||
|
||
import org.springframework.core.NestedRuntimeException; | ||
|
||
public class SslBundleUsageOrCertificatePinningException extends NestedRuntimeException { | ||
|
||
private final String clientId; | ||
|
||
public SslBundleUsageOrCertificatePinningException(final String clientId) { | ||
super(createMessage(clientId)); | ||
this.clientId = clientId; | ||
} | ||
|
||
public SslBundleUsageOrCertificatePinningException(String clientId, String msg) { | ||
super(msg); | ||
this.clientId = clientId; | ||
} | ||
|
||
public SslBundleUsageOrCertificatePinningException(String clientId, String msg, Throwable cause) { | ||
super(msg, cause); | ||
this.clientId = clientId; | ||
} | ||
|
||
protected static String createMessage(String clientId) { | ||
return String.format("CertificatePinning and SslBundleUsage configured at same time in http-client : '%s'", clientId); | ||
} | ||
|
||
public String getClientId() { | ||
return clientId; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../org/zalando/riptide/autoconfigure/SslBundleUsageOrCertificatePinningFailureAnalyzer.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,22 @@ | ||
package org.zalando.riptide.autoconfigure; | ||
|
||
import org.springframework.boot.diagnostics.AbstractFailureAnalyzer; | ||
import org.springframework.boot.diagnostics.FailureAnalysis; | ||
|
||
public class SslBundleUsageOrCertificatePinningFailureAnalyzer extends | ||
AbstractFailureAnalyzer<SslBundleUsageOrCertificatePinningException> { | ||
|
||
@Override | ||
protected FailureAnalysis analyze(Throwable rootFailure, | ||
SslBundleUsageOrCertificatePinningException cause) { | ||
return new FailureAnalysis(getDescription(cause), getAction(cause), cause); | ||
} | ||
|
||
private String getDescription(SslBundleUsageOrCertificatePinningException cause) { | ||
return String.format("The http-client '%s' is configured to use CertificatePinning and SslBundleUsage at the same time.", cause.getClientId()); | ||
} | ||
|
||
private String getAction(SslBundleUsageOrCertificatePinningException cause) { | ||
return String.format("Configure only CertificatePinning or SslBundleUsage for http-client '%s'", cause.getClientId()); | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
riptide-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
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,2 @@ | ||
org.springframework.boot.diagnostics.FailureAnalyzer=\ | ||
org.zalando.riptide.autoconfigure.SslBundleUsageOrCertificatePinningFailureAnalyzer |
Oops, something went wrong.