sonic-net / sonic-gnmi

SONiC gNMI server and gNOI repo
Other
22 stars 52 forks source link

First record does not look like a TLS handshake #272

Open tsmjay opened 3 months ago

tsmjay commented 3 months ago

Hi,

If I take any of the recent builds of SONiC, run them in GNS3, get a bash shell inside the 'docker-sonic-gnmi' container, and run the example gNMI 'get' command, I get the following:

root@sonic:/# gnmi_get -insecure -username admin -password YourPaSsWoRd -xpath /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config -target_addr 127.0.0.1:8080 -xpath_target OC-YANG
== getRequest:
prefix: <
  target: "OC-YANG"
>
path: <
  origin: "openconfig-interfaces"
  elem: <
    name: "interfaces"
  >
  elem: <
    name: "interface"
    key: <
      key: "name"
      value: "Ethernet0"
    >
  >
  elem: <
    name: "config"
  >
>
encoding: JSON_IETF

F0719 18:58:12.816922      67 gnmi_get.go:145] Get failed: rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: tls: first record does not look like a TLS handshake"
root@sonic:/#

I have tested the master, 202405, 202311 and 202305 branches.

Am I missing something?

Thanks.

fishingfly commented 2 months ago

try?

gnmi_get -notls -username admin -password YourPaSsWoRd -xpath /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config -target_addr 127.0.0.1:8080 -xpath_target OC-YANG
puffc commented 5 days ago

@fishingfly root@sonic:/# gnmi_get -notls -username admin -password YourPaSsWoRd -xpath /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config -target_addr 127.0.0.1:8080 -xpath_target OC-YANG F1107 08:22:16.200512 1098 gnmi_get.go:86] Dialing to "127.0.0.1:8080" failed: grpc: the credentials require transport level security (use grpc.WithTransportCredentials() to set)