36
36
* Unlike the deprecated {@link KerberosConfig}, this class uses explicit defaults, and
37
37
* primitive booleans.
38
38
*
39
+ * Compared to {@link KerberosConfig} stripPort has been changed toAddPort, and the default is now
40
+ * false (same effect). The default for useCanonicalHostname has been changed to false from true.
41
+ *
39
42
* @since 5.5
40
43
*
41
44
*/
@@ -45,7 +48,7 @@ public class MutualKerberosConfig implements Cloneable {
45
48
46
49
public static final MutualKerberosConfig DEFAULT = new Builder ().build ();
47
50
48
- private final boolean stripPort ;
51
+ private final boolean addPort ;
49
52
private final boolean useCanonicalHostname ;
50
53
private final boolean requestMutualAuth ;
51
54
private final boolean requestDelegCreds ;
@@ -54,7 +57,7 @@ public class MutualKerberosConfig implements Cloneable {
54
57
* Intended for CDI compatibility
55
58
*/
56
59
protected MutualKerberosConfig () {
57
- this (true , true , true , false );
60
+ this (false , false , true , false );
58
61
}
59
62
60
63
MutualKerberosConfig (
@@ -63,14 +66,14 @@ protected MutualKerberosConfig() {
63
66
final boolean requestMutualAuth ,
64
67
final boolean requestDelegCreds ) {
65
68
super ();
66
- this .stripPort = stripPort ;
69
+ this .addPort = stripPort ;
67
70
this .useCanonicalHostname = useCanonicalHostname ;
68
71
this .requestMutualAuth = requestMutualAuth ;
69
72
this .requestDelegCreds = requestDelegCreds ;
70
73
}
71
74
72
- public boolean isStripPort () {
73
- return stripPort ;
75
+ public boolean isAddPort () {
76
+ return addPort ;
74
77
}
75
78
76
79
public boolean isUseCanonicalHostname () {
@@ -94,7 +97,7 @@ protected MutualKerberosConfig clone() throws CloneNotSupportedException {
94
97
public String toString () {
95
98
final StringBuilder builder = new StringBuilder ();
96
99
builder .append ("[" );
97
- builder .append ("stripPort =" ).append (stripPort );
100
+ builder .append ("addPort =" ).append (addPort );
98
101
builder .append (", useCanonicalHostname=" ).append (useCanonicalHostname );
99
102
builder .append (", requestDelegCreds=" ).append (requestDelegCreds );
100
103
builder .append (", requestMutualAuth=" ).append (requestMutualAuth );
@@ -108,25 +111,25 @@ public static MutualKerberosConfig.Builder custom() {
108
111
109
112
public static MutualKerberosConfig .Builder copy (final MutualKerberosConfig config ) {
110
113
return new Builder ()
111
- .setStripPort (config .isStripPort ())
114
+ .setAddPort (config .isAddPort ())
112
115
.setUseCanonicalHostname (config .isUseCanonicalHostname ())
113
116
.setRequestDelegCreds (config .isRequestDelegCreds ())
114
117
.setRequestMutualAuth (config .isRequestMutualAuth ());
115
118
}
116
119
117
120
public static class Builder {
118
121
119
- private boolean stripPort = true ;
120
- private boolean useCanonicalHostname = true ;
122
+ private boolean addPort = false ;
123
+ private boolean useCanonicalHostname = false ;
121
124
private boolean requestMutualAuth = true ;
122
125
private boolean requestDelegCreds = false ;
123
126
124
127
Builder () {
125
128
super ();
126
129
}
127
130
128
- public Builder setStripPort (final boolean stripPort ) {
129
- this .stripPort = stripPort ;
131
+ public Builder setAddPort (final boolean addPort ) {
132
+ this .addPort = addPort ;
130
133
return this ;
131
134
}
132
135
@@ -147,7 +150,7 @@ public Builder setRequestDelegCreds(final boolean requuestDelegCreds) {
147
150
148
151
public MutualKerberosConfig build () {
149
152
return new MutualKerberosConfig (
150
- stripPort ,
153
+ addPort ,
151
154
useCanonicalHostname ,
152
155
requestMutualAuth ,
153
156
requestDelegCreds
0 commit comments