I'm trying to get done some RESTful stuff with Ruby std. libraries, 'uri' and 'net/https.' I'd like to reach link-local IPv6 address with explicitly specified outgoing interface, for example fe80::cba7:32b1:741d:5c41%ens192
.
Whent I'm trying to create a new URI instance - I'm still receiving the same error (for both examples below):
URI("https://[fe80::cba7:32b1:741d:5c41%ens192]/")
URI("https://[fe80::cba7:32b1:741d:5c41%25ens192]/")
returns
URI::InvalidURIError: bad URI(is not URI?)
Please do you have any idea how to handle these IPv6 link-local addresses? Just for the reference I've tried to make a simple HTTP request, it works. So generally, Ruby has no issue with IPv6 :)
require 'net/https'
request = Net::HTTP.new('fe80::cba7:32b1:741d:5c41%ens192', 443)
request.use_ssl = true
request.verify_mode = OpenSSL::SSL::VERIFY_NONE
request.get('/')
Thanks in advance!