Skip to content

Commit 9ae44b3

Browse files
ulrichardksedgwic
authored andcommitted
read the GRPC endpoint from the env var REMOTE_HSMD_ENDPOINT (#22)
1 parent 7196f36 commit 9ae44b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

contrib/remote_hsmd/proxy.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,11 @@ const char *proxy_last_message(void)
350350

351351
void proxy_setup()
352352
{
353-
STATUS_DEBUG("%s:%d %s pid:%d", __FILE__, __LINE__, __FUNCTION__, getpid());
354-
auto channel = grpc::CreateChannel("localhost:50051",
353+
const char *endpointvar = getenv("REMOTE_HSMD_ENDPOINT");
354+
const char *endpoint = endpointvar != NULL ? endpointvar : "localhost:50051";
355+
STATUS_DEBUG("%s:%d %s pid:%d endpoint:%s",
356+
__FILE__, __LINE__, __FUNCTION__, getpid(), endpoint);
357+
auto channel = grpc::CreateChannel(endpoint,
355358
grpc::InsecureChannelCredentials());
356359
stub = Signer::NewStub(channel);
357360
last_message = "";

0 commit comments

Comments
 (0)