@@ -196,8 +196,8 @@ func (org *testOrg) testServers(port int, clientRootCAs [][]byte) []testServer {
196
196
comm.ServerConfig {
197
197
SecOpts : & comm.SecureOptions {
198
198
UseTLS : true ,
199
- ServerCertificate : serverCert .certPEM ,
200
- ServerKey : serverCert .keyPEM ,
199
+ Certificate : serverCert .certPEM ,
200
+ Key : serverCert .keyPEM ,
201
201
RequireClientCert : true ,
202
202
ClientRootCAs : clientRootCAs ,
203
203
},
@@ -395,39 +395,39 @@ func TestNewGRPCServerInvalidParameters(t *testing.T) {
395
395
t .Log (err .Error ())
396
396
}
397
397
398
- //missing serverCertificate
398
+ //missing server Certificate
399
399
_ , err = comm .NewGRPCServer (":9041" ,
400
400
comm.ServerConfig {
401
401
SecOpts : & comm.SecureOptions {
402
- UseTLS : true ,
403
- ServerCertificate : []byte {}}})
402
+ UseTLS : true ,
403
+ Certificate : []byte {}}})
404
404
//check for error
405
- msg = "serverConfig.SecOpts must contain both ServerKey and " +
406
- "ServerCertificate when UseTLS is true"
405
+ msg = "serverConfig.SecOpts must contain both Key and " +
406
+ "Certificate when UseTLS is true"
407
407
assert .EqualError (t , err , msg )
408
408
if err != nil {
409
409
t .Log (err .Error ())
410
410
}
411
411
412
- //missing serverKey
412
+ //missing server Key
413
413
_ , err = comm .NewGRPCServer (":9042" ,
414
414
comm.ServerConfig {
415
415
SecOpts : & comm.SecureOptions {
416
- UseTLS : true ,
417
- ServerCertificate : []byte {}}})
416
+ UseTLS : true ,
417
+ Certificate : []byte {}}})
418
418
//check for error
419
419
assert .EqualError (t , err , msg )
420
420
if err != nil {
421
421
t .Log (err .Error ())
422
422
}
423
423
424
- //bad serverKey
424
+ //bad server Key
425
425
_ , err = comm .NewGRPCServer (":9043" ,
426
426
comm.ServerConfig {
427
427
SecOpts : & comm.SecureOptions {
428
- UseTLS : true ,
429
- ServerCertificate : []byte (selfSignedCertPEM ),
430
- ServerKey : []byte {}}})
428
+ UseTLS : true ,
429
+ Certificate : []byte (selfSignedCertPEM ),
430
+ Key : []byte {}}})
431
431
432
432
//check for error
433
433
msg = "tls: failed to find any PEM data in key input"
@@ -436,13 +436,13 @@ func TestNewGRPCServerInvalidParameters(t *testing.T) {
436
436
t .Log (err .Error ())
437
437
}
438
438
439
- //bad serverCertificate
439
+ //bad server Certificate
440
440
_ , err = comm .NewGRPCServer (":9044" ,
441
441
comm.ServerConfig {
442
442
SecOpts : & comm.SecureOptions {
443
- UseTLS : true ,
444
- ServerCertificate : []byte {},
445
- ServerKey : []byte (selfSignedKeyPEM )}})
443
+ UseTLS : true ,
444
+ Certificate : []byte {},
445
+ Key : []byte (selfSignedKeyPEM )}})
446
446
//check for error
447
447
msg = "tls: failed to find any PEM data in certificate input"
448
448
assert .EqualError (t , err , msg )
@@ -454,8 +454,8 @@ func TestNewGRPCServerInvalidParameters(t *testing.T) {
454
454
comm.ServerConfig {
455
455
SecOpts : & comm.SecureOptions {
456
456
UseTLS : true ,
457
- ServerCertificate : []byte (selfSignedCertPEM ),
458
- ServerKey : []byte (selfSignedKeyPEM ),
457
+ Certificate : []byte (selfSignedCertPEM ),
458
+ Key : []byte (selfSignedKeyPEM ),
459
459
RequireClientCert : true }})
460
460
badRootCAs := [][]byte {[]byte (badPEM )}
461
461
err = srv .SetClientRootCAs (badRootCAs )
@@ -576,9 +576,9 @@ func TestNewSecureGRPCServer(t *testing.T) {
576
576
testAddress := "localhost:9055"
577
577
srv , err := comm .NewGRPCServer (testAddress , comm.ServerConfig {
578
578
SecOpts : & comm.SecureOptions {
579
- UseTLS : true ,
580
- ServerCertificate : []byte (selfSignedCertPEM ),
581
- ServerKey : []byte (selfSignedKeyPEM )}})
579
+ UseTLS : true ,
580
+ Certificate : []byte (selfSignedCertPEM ),
581
+ Key : []byte (selfSignedKeyPEM )}})
582
582
//check for error
583
583
if err != nil {
584
584
t .Fatalf ("Failed to return new GRPC server: %v" , err )
@@ -661,9 +661,9 @@ func TestNewSecureGRPCServerFromListener(t *testing.T) {
661
661
662
662
srv , err := comm .NewGRPCServerFromListener (lis , comm.ServerConfig {
663
663
SecOpts : & comm.SecureOptions {
664
- UseTLS : true ,
665
- ServerCertificate : []byte (selfSignedCertPEM ),
666
- ServerKey : []byte (selfSignedKeyPEM )}})
664
+ UseTLS : true ,
665
+ Certificate : []byte (selfSignedCertPEM ),
666
+ Key : []byte (selfSignedKeyPEM )}})
667
667
//check for error
668
668
if err != nil {
669
669
t .Fatalf ("Failed to return new GRPC server: %v" , err )
@@ -743,9 +743,9 @@ func TestWithSignedRootCertificates(t *testing.T) {
743
743
744
744
srv , err := comm .NewGRPCServerFromListener (lis , comm.ServerConfig {
745
745
SecOpts : & comm.SecureOptions {
746
- UseTLS : true ,
747
- ServerCertificate : certPEMBlock ,
748
- ServerKey : keyPEMBlock }})
746
+ UseTLS : true ,
747
+ Certificate : certPEMBlock ,
748
+ Key : keyPEMBlock }})
749
749
//check for error
750
750
if err != nil {
751
751
t .Fatalf ("Failed to return new GRPC server: %v" , err )
@@ -822,9 +822,9 @@ func TestWithSignedIntermediateCertificates(t *testing.T) {
822
822
823
823
srv , err := comm .NewGRPCServerFromListener (lis , comm.ServerConfig {
824
824
SecOpts : & comm.SecureOptions {
825
- UseTLS : true ,
826
- ServerCertificate : certPEMBlock ,
827
- ServerKey : keyPEMBlock }})
825
+ UseTLS : true ,
826
+ Certificate : certPEMBlock ,
827
+ Key : keyPEMBlock }})
828
828
//check for error
829
829
if err != nil {
830
830
t .Fatalf ("Failed to return new GRPC server: %v" , err )
@@ -1444,9 +1444,9 @@ func TestUpdateTLSCert(t *testing.T) {
1444
1444
1445
1445
cfg := comm.ServerConfig {
1446
1446
SecOpts : & comm.SecureOptions {
1447
- UseTLS : true ,
1448
- ServerKey : key ,
1449
- ServerCertificate : cert ,
1447
+ UseTLS : true ,
1448
+ Key : key ,
1449
+ Certificate : cert ,
1450
1450
},
1451
1451
}
1452
1452
srv , err := comm .NewGRPCServer ("localhost:8333" , cfg )
@@ -1536,9 +1536,9 @@ func TestCipherSuites(t *testing.T) {
1536
1536
1537
1537
serverConfig := comm.ServerConfig {
1538
1538
SecOpts : & comm.SecureOptions {
1539
- ServerCertificate : certPEM ,
1540
- ServerKey : keyPEM ,
1541
- UseTLS : true ,
1539
+ Certificate : certPEM ,
1540
+ Key : keyPEM ,
1541
+ UseTLS : true ,
1542
1542
}}
1543
1543
1544
1544
var tests = []struct {
0 commit comments