@@ -134,14 +134,14 @@ func (s) TestClientOptionsConfigErrorCases(t *testing.T) {
134
134
for _ , test := range tests {
135
135
test := test
136
136
t .Run (test .desc , func (t * testing.T ) {
137
- clientOptions := & ClientOptions {
137
+ clientOptions := & Options {
138
138
VerificationType : test .clientVerificationType ,
139
139
IdentityOptions : test .IdentityOptions ,
140
140
RootOptions : test .RootOptions ,
141
141
MinTLSVersion : test .MinVersion ,
142
142
MaxTLSVersion : test .MaxVersion ,
143
143
}
144
- _ , err := clientOptions .config ()
144
+ _ , err := clientOptions .clientConfig ()
145
145
if err == nil {
146
146
t .Fatalf ("ClientOptions{%v}.config() returns no err, wantErr != nil" , clientOptions )
147
147
}
@@ -154,10 +154,10 @@ func (s) TestClientOptionsConfigErrorCases(t *testing.T) {
154
154
// VerificationType. This should error because one cannot skip default
155
155
// verification and provide no root credentials",
156
156
func (s ) TestClientOptionsWithDeprecatedVType (t * testing.T ) {
157
- clientOptions := & ClientOptions {
157
+ clientOptions := & Options {
158
158
VType : SkipVerification ,
159
159
}
160
- _ , err := clientOptions .config ()
160
+ _ , err := clientOptions .clientConfig ()
161
161
if err == nil {
162
162
t .Fatalf ("ClientOptions{%v}.config() returns no err, wantErr != nil" , clientOptions )
163
163
}
@@ -192,14 +192,14 @@ func (s) TestClientOptionsConfigSuccessCases(t *testing.T) {
192
192
for _ , test := range tests {
193
193
test := test
194
194
t .Run (test .desc , func (t * testing.T ) {
195
- clientOptions := & ClientOptions {
195
+ clientOptions := & Options {
196
196
VerificationType : test .clientVerificationType ,
197
197
IdentityOptions : test .IdentityOptions ,
198
198
RootOptions : test .RootOptions ,
199
199
MinTLSVersion : test .MinVersion ,
200
200
MaxTLSVersion : test .MaxVersion ,
201
201
}
202
- clientConfig , err := clientOptions .config ()
202
+ clientConfig , err := clientOptions .clientConfig ()
203
203
if err != nil {
204
204
t .Fatalf ("ClientOptions{%v}.config() = %v, wantErr == nil" , clientOptions , err )
205
205
}
@@ -288,17 +288,17 @@ func (s) TestServerOptionsConfigErrorCases(t *testing.T) {
288
288
for _ , test := range tests {
289
289
test := test
290
290
t .Run (test .desc , func (t * testing.T ) {
291
- serverOptions := & ServerOptions {
291
+ serverOptions := & Options {
292
292
VerificationType : test .serverVerificationType ,
293
293
RequireClientCert : test .requireClientCert ,
294
294
IdentityOptions : test .IdentityOptions ,
295
295
RootOptions : test .RootOptions ,
296
296
MinTLSVersion : test .MinVersion ,
297
297
MaxTLSVersion : test .MaxVersion ,
298
298
}
299
- _ , err := serverOptions .config ()
299
+ _ , err := serverOptions .serverConfig ()
300
300
if err == nil {
301
- t .Fatalf ("ServerOptions{%v}.config () returns no err, wantErr != nil" , serverOptions )
301
+ t .Fatalf ("ServerOptions{%v}.serverConfig () returns no err, wantErr != nil" , serverOptions )
302
302
}
303
303
})
304
304
}
@@ -309,10 +309,10 @@ func (s) TestServerOptionsConfigErrorCases(t *testing.T) {
309
309
// VerificationType. This should error because one cannot skip default
310
310
// verification and provide no root credentials",
311
311
func (s ) TestServerOptionsWithDeprecatedVType (t * testing.T ) {
312
- serverOptions := & ServerOptions {
312
+ serverOptions := & Options {
313
313
VType : SkipVerification ,
314
314
}
315
- _ , err := serverOptions .config ()
315
+ _ , err := serverOptions .serverConfig ()
316
316
if err == nil {
317
317
t .Fatalf ("ClientOptions{%v}.config() returns no err, wantErr != nil" , serverOptions )
318
318
}
@@ -355,15 +355,15 @@ func (s) TestServerOptionsConfigSuccessCases(t *testing.T) {
355
355
for _ , test := range tests {
356
356
test := test
357
357
t .Run (test .desc , func (t * testing.T ) {
358
- serverOptions := & ServerOptions {
358
+ serverOptions := & Options {
359
359
VerificationType : test .serverVerificationType ,
360
360
RequireClientCert : test .requireClientCert ,
361
361
IdentityOptions : test .IdentityOptions ,
362
362
RootOptions : test .RootOptions ,
363
363
MinTLSVersion : test .MinVersion ,
364
364
MaxTLSVersion : test .MaxVersion ,
365
365
}
366
- serverConfig , err := serverOptions .config ()
366
+ serverConfig , err := serverOptions .serverConfig ()
367
367
if err != nil {
368
368
t .Fatalf ("ServerOptions{%v}.config() = %v, wantErr == nil" , serverOptions , err )
369
369
}
@@ -829,7 +829,7 @@ func (s) TestClientServerHandshake(t *testing.T) {
829
829
t .Fatalf ("Failed to listen: %v" , err )
830
830
}
831
831
// Start a server using ServerOptions in another goroutine.
832
- serverOptions := & ServerOptions {
832
+ serverOptions := & Options {
833
833
IdentityOptions : IdentityCertificateOptions {
834
834
Certificates : test .serverCert ,
835
835
GetIdentityCertificatesForServer : test .serverGetCert ,
@@ -845,7 +845,7 @@ func (s) TestClientServerHandshake(t *testing.T) {
845
845
VerificationType : test .serverVerificationType ,
846
846
RevocationOptions : test .serverRevocationOptions ,
847
847
}
848
- go func (done chan credentials.AuthInfo , lis net.Listener , serverOptions * ServerOptions ) {
848
+ go func (done chan credentials.AuthInfo , lis net.Listener , serverOptions * Options ) {
849
849
serverRawConn , err := lis .Accept ()
850
850
if err != nil {
851
851
close (done )
@@ -873,7 +873,7 @@ func (s) TestClientServerHandshake(t *testing.T) {
873
873
t .Fatalf ("Client failed to connect to %s. Error: %v" , lisAddr , err )
874
874
}
875
875
defer conn .Close ()
876
- clientOptions := & ClientOptions {
876
+ clientOptions := & Options {
877
877
IdentityOptions : IdentityCertificateOptions {
878
878
Certificates : test .clientCert ,
879
879
GetIdentityCertificatesForClient : test .clientGetCert ,
@@ -944,7 +944,7 @@ func (s) TestAdvancedTLSOverrideServerName(t *testing.T) {
944
944
if err := cs .LoadCerts (); err != nil {
945
945
t .Fatalf ("cs.LoadCerts() failed, err: %v" , err )
946
946
}
947
- clientOptions := & ClientOptions {
947
+ clientOptions := & Options {
948
948
RootOptions : RootCertificateOptions {
949
949
RootCACerts : cs .ClientTrust1 ,
950
950
},
@@ -988,16 +988,16 @@ func (s) TestGetCertificatesSNI(t *testing.T) {
988
988
for _ , test := range tests {
989
989
test := test
990
990
t .Run (test .desc , func (t * testing.T ) {
991
- serverOptions := & ServerOptions {
991
+ serverOptions := & Options {
992
992
IdentityOptions : IdentityCertificateOptions {
993
993
GetIdentityCertificatesForServer : func (info * tls.ClientHelloInfo ) ([]* tls.Certificate , error ) {
994
994
return []* tls.Certificate {& cs .ServerCert1 , & cs .ServerCert2 , & cs .ServerPeer3 }, nil
995
995
},
996
996
},
997
997
}
998
- serverConfig , err := serverOptions .config ()
998
+ serverConfig , err := serverOptions .serverConfig ()
999
999
if err != nil {
1000
- t .Fatalf ("serverOptions.config () failed: %v" , err )
1000
+ t .Fatalf ("serverOptions.serverConfig () failed: %v" , err )
1001
1001
}
1002
1002
pointFormatUncompressed := uint8 (0 )
1003
1003
clientHello := & tls.ClientHelloInfo {
0 commit comments