ctron / oidc-cli

A command line tool to work with OIDC tokens
Apache License 2.0
0 stars 0 forks source link

Failed to listen on IPv6 #1

Closed leesei closed 4 days ago

leesei commented 1 week ago

It may be on me, but I failed to use oidc-cli because it tries to bind IPv6 address.

$ oidc-cli create public keycloak_pub --issuer http://192.168.1.9:8080/realms/my-realm --client-id my-app
10:19:43 [ERROR] Address not available (os error 99)

I can use it after changing this line:

-       let addr = SocketAddr::new(Ipv6Addr::LOCALHOST.into(), port);
+       let addr = SocketAddr::new(Ipv4Addr::LOCALHOST.into(), port);

It is sad to see that IPv6 still have such paper cuts nowadays. I've enabled IPv6 at least :stuck_out_tongue_closed_eyes:. Is there any particular reason for using IPv6? BTW, I'm using Arch.

ctron commented 1 week ago

Interesting, and thanks for reporting.

I would love to have some kind of "just bind to something" :)

I never had any issues with IPv6 in the past, that was the main motivation. I guess having some way to auto-detect this (and fall back) or some -4 switch would make sense.

Any chance you can come up with a PR for this?

leesei commented 6 days ago

I also hoped IPv6 to "just work".

I can submit a PR for binding to IPv4 address. But adding CLI parameter in Rust program is out of my capability at the moment 😄.