【问题标题】:Does openssl understand link-local IPv6 address?openssl 是否理解链接本地 IPv6 地址?
【发布时间】:2018-02-07 19:11:56
【问题描述】:

我无法理解为什么这个命令不起作用:

openssl s_client -connect [fe80::xxxx:xxxx:xxxx:xxxx]:yyyy

注意:我用x's 混淆了上面的链接本地地址,但我有一些有效的链接本地ipv6 地址。 yyyy 是端口号。

我得到错误:

1995535248:error:02002016:system library:connect:Invalid argument:../crypto/bio/b_sock2.c:108:
1995535248:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:109:
connect:errno=22

我也试过加单引号/双引号,但还是出现了同样的错误:

openssl s_client -connect '[fe80::xxxx:xxxx:xxxx:xxxx]:yyyy'

我使用的是 OpenSSL 1.1.0f 版本,它应该支持 IPv6。

使用 IPv4 地址,它可以工作。

【问题讨论】:

  • 您不能在不指定链接的情况下使用链接本地地址。 OpenSSL是否会理解我不知道,但你上面给出的例子肯定行不通

标签: openssl ipv6 link-local


【解决方案1】:

IPv6 链接本地地址需要范围 ID,但您似乎没有。因此,您的地址无效,而您收到的错误 Invalid argument 确实是问题所在。

要修复它,请添加正确的范围 ID,即您要连接的接口。例如:

# openssl s_client -connect "[fe80::e1f5:ba3f:9ae5:4fe9%wlp5s0]:443"
CONNECTED(00000003)
depth=0 C = --, ST = SomeState, L = SomeCity, O = SomeOrganization, OU = SomeOrganizationalUnit, CN = localhost.localdomain, emailAddress = root@localhost.localdomain
verify error:num=18:self signed certificate
verify return:1
depth=0 C = --, ST = SomeState, L = SomeCity, O = SomeOrganization, OU = SomeOrganizationalUnit, CN = localhost.localdomain, emailAddress = root@localhost.localdomain
verify return:1

【讨论】:

    猜你喜欢
    • 2018-12-04
    • 1970-01-01
    • 2011-08-10
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 2016-04-18
    • 1970-01-01
    相关资源
    最近更新 更多