@@ -23,7 +23,6 @@ import (
2323 pubPB "github.com/letsencrypt/boulder/publisher/proto"
2424 "github.com/letsencrypt/boulder/ra"
2525 rapb "github.com/letsencrypt/boulder/ra/proto"
26- "github.com/letsencrypt/boulder/rpc"
2726 sapb "github.com/letsencrypt/boulder/sa/proto"
2827)
2928
@@ -36,8 +35,6 @@ type config struct {
3635
3736 RateLimitPoliciesFilename string
3837
39- MaxConcurrentRPCServerRequests int64
40-
4138 MaxContactsPerRegistration int
4239
4340 // UseIsSafeDomain determines whether to call VA.IsSafeDomain
@@ -128,29 +125,16 @@ func main() {
128125 cmd .FailOnError (err , "TLS config" )
129126 }
130127
131- amqpConf := c .RA .AMQP
132- var vac core.ValidationAuthority
133- if c .RA .VAService != nil {
134- conn , err := bgrpc .ClientSetup (c .RA .VAService , tls , scope )
135- cmd .FailOnError (err , "Unable to create VA client" )
136- vac = bgrpc .NewValidationAuthorityGRPCClient (conn )
137- } else {
138- vac , err = rpc .NewValidationAuthorityClient (clientName , amqpConf , scope )
139- cmd .FailOnError (err , "Unable to create VA client" )
140- }
128+ vaConn , err := bgrpc .ClientSetup (c .RA .VAService , tls , scope )
129+ cmd .FailOnError (err , "Unable to create VA client" )
130+ vac := bgrpc .NewValidationAuthorityGRPCClient (vaConn )
141131
142- var cac core.CertificateAuthority
143- if c .RA .CAService != nil {
144- conn , err := bgrpc .ClientSetup (c .RA .CAService , tls , scope )
145- cmd .FailOnError (err , "Unable to create CA client" )
146- // Build a CA client that is only capable of issuing certificates, not
147- // signing OCSP. TODO(jsha): Once we've fully moved to gRPC, replace this
148- // with a plain caPB.NewCertificateAuthorityClient.
149- cac = bgrpc .NewCertificateAuthorityClient (caPB .NewCertificateAuthorityClient (conn ), nil )
150- } else {
151- cac , err = rpc .NewCertificateAuthorityClient (clientName , amqpConf , scope )
152- cmd .FailOnError (err , "Unable to create CA client" )
153- }
132+ caConn , err := bgrpc .ClientSetup (c .RA .CAService , tls , scope )
133+ cmd .FailOnError (err , "Unable to create CA client" )
134+ // Build a CA client that is only capable of issuing certificates, not
135+ // signing OCSP. TODO(jsha): Once we've fully moved to gRPC, replace this
136+ // with a plain caPB.NewCertificateAuthorityClient.
137+ cac := bgrpc .NewCertificateAuthorityClient (caPB .NewCertificateAuthorityClient (caConn ), nil )
154138
155139 var pubc core.Publisher
156140 if c .RA .PublisherService != nil {
@@ -159,15 +143,9 @@ func main() {
159143 pubc = bgrpc .NewPublisherClientWrapper (pubPB .NewPublisherClient (conn ))
160144 }
161145
162- var sac core.StorageAuthority
163- if c .RA .SAService != nil {
164- conn , err := bgrpc .ClientSetup (c .RA .SAService , tls , scope )
165- cmd .FailOnError (err , "Failed to load credentials and create gRPC connection to SA" )
166- sac = bgrpc .NewStorageAuthorityClient (sapb .NewStorageAuthorityClient (conn ))
167- } else {
168- sac , err = rpc .NewStorageAuthorityClient (clientName , amqpConf , scope )
169- cmd .FailOnError (err , "Unable to create SA client" )
170- }
146+ conn , err := bgrpc .ClientSetup (c .RA .SAService , tls , scope )
147+ cmd .FailOnError (err , "Failed to load credentials and create gRPC connection to SA" )
148+ sac := bgrpc .NewStorageAuthorityClient (sapb .NewStorageAuthorityClient (conn ))
171149
172150 // TODO(patf): remove once RA.authorizationLifetimeDays is deployed
173151 authorizationLifetime := 300 * 24 * time .Hour
@@ -241,22 +219,14 @@ func main() {
241219 }()
242220 }
243221
244- ras , err := rpc .NewAmqpRPCServer (amqpConf , c .RA .MaxConcurrentRPCServerRequests , scope , logger )
245- cmd .FailOnError (err , "Unable to create RA RPC server" )
246-
247222 go cmd .CatchSignals (logger , func () {
248- ras .Stop ()
249223 if grpcSrv != nil {
250224 grpcSrv .GracefulStop ()
251225 }
252226 })
253227
254- err = rpc .NewRegistrationAuthorityServer (ras , rai , logger )
255- cmd .FailOnError (err , "Unable to setup RA RPC server" )
256-
257228 go cmd .DebugServer (c .RA .DebugAddr )
258229 go cmd .ProfileCmd (scope )
259230
260- err = ras .Start (amqpConf )
261- cmd .FailOnError (err , "Unable to run RA RPC server" )
231+ select {}
262232}
0 commit comments