summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/Constants.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/gitblit/Constants.java')
-rw-r--r--src/main/java/com/gitblit/Constants.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/Constants.java b/src/main/java/com/gitblit/Constants.java
index ab503bd3..c73bc24b 100644
--- a/src/main/java/com/gitblit/Constants.java
+++ b/src/main/java/com/gitblit/Constants.java
@@ -645,6 +645,28 @@ public class Constants {
}
}
+ public enum TlsClientCertPolicy {
+ REQUIRED, TRUE, OPTIONAL, FALSE, DISABLED, NONE;
+
+ public static TlsClientCertPolicy fromString(String value) {
+ for (TlsClientCertPolicy t : values()) {
+ if (t.name().equalsIgnoreCase(value)) {
+ switch(t) {
+ case TRUE:
+ return REQUIRED;
+ case FALSE:
+ return OPTIONAL;
+ case NONE:
+ return DISABLED;
+ default:
+ return t;
+ }
+ }
+ }
+ return TlsClientCertPolicy.OPTIONAL;
+ }
+ }
+
/**
* The type of merge Gitblit will use when merging a ticket to the integration branch.
* <p>