(node:22344) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permit

(node:22344) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permit@[TOC]((node:22344)[DEP0123]DeprecationWarning:SettingtheTLSServerNametoanIPaddressisnotpermittedbyRFC6066)1

(node):22344 [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066

1、原因

nodejs采用https访问数据库时,不可以直接书写ip地址,
在这里插入图片描述

2、解决方案

  • 把ip地址更改为域名
    如何建立ip和域名映射,请参考我的另外一篇博客:域名映射到指定IP

3、验证

建立完映射后,把host处的ip地址改写为域名
在这里插入图片描述

备注:还有另外一种解决方案,需要修改nodejs模块的代码,具体参考Skip TLS SNI if host is IP address

参考:
【1】Add Documentation About [DEP0123] When Using IP’s For Hostnames #1950:https://github.com/brianc/node-postgres/issues/1950
【2】Skip TLS SNI if host is IP address :https://github.com/brianc/node-postgres/pull/1890

今天的文章(node:22344) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permit分享到此就结束了,感谢您的阅读。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:http://bianchenghao.cn/87588.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注