Configure whether to dial secure connection to remote Nitro node

This commit is contained in:
neeraj
2023-10-18 18:19:36 +05:30
committed by prathamesh
parent b52f83c0d7
commit 71c028435d
4 changed files with 9 additions and 2 deletions
+2
View File
@@ -57,6 +57,7 @@ func addNitroFlags(command *cobra.Command) {
command.PersistentFlags().String("nitro-tls-key-filepath", "", "nitro tlsKeyFilepath")
command.PersistentFlags().String("nitro-endpoint", "", "nitro endpoint")
command.PersistentFlags().Bool("nitro-is-secure", false, "nitro isSecure")
// nitro flag bindings
viper.BindPFlag("nitro.runNodeInProcess", command.PersistentFlags().Lookup("nitro-run-node-in-process"))
@@ -78,4 +79,5 @@ func addNitroFlags(command *cobra.Command) {
viper.BindPFlag("nitro.inProcesssNode.tlsKeyFilepath", command.PersistentFlags().Lookup("nitro-tls-key-filepath"))
viper.BindPFlag("nitro.remoteNode.nitroEndpoint", command.PersistentFlags().Lookup("nitro-endpoint"))
viper.BindPFlag("nitro.remoteNode.isSecure", command.PersistentFlags().Lookup("nitro-is-secure"))
}
+1 -2
View File
@@ -135,8 +135,7 @@ func serve() {
} else {
log.Info("Connecting to a remote Nitro node")
// TODO: Read from config file
isSecure := false
isSecure := nitroConfig.RemoteNode.IsSecure
nitroRpcClient, err := nitroRpc.NewHttpRpcClient(nitroConfig.RemoteNode.NitroEndpoint, isSecure)
if err != nil {
logWithCommand.Fatal(err)