Nacos 2.2.1启动报错

错误信息:

The specified key byte array is 248 bits which is not secure enough

for any JWT HMAC-SHA algorithm. The JWT JWA Specification (RFC 7518,

Section 3.2) states that keys used with HMAC-SHA algorithms MUST have

a size >= 256 bits (the key size must be greater than or equal to the

hash output size). See

https://tools.ietf.org/html/rfc7518#section-3.2 for more information.

翻译如下:

指定的密钥字节数组是248位,这对于任何JWT HMAC-SHA算法来说都不够安全。JWT JWA规范(RFC

7518,第3.2节)规定,与HMAC-SHA算法一起使用的密钥必须具有>=256位的大小(密钥大小必须大于或等于哈希输出大小)。看见https://tools.ietf.org/html/rfc7518#section-3.2了解更多信息。

解决办法:

修改 Nacos/config 文件夹里面 application.properties 文件,在大约第156行:

yaml 复制代码
### The default token (Base64 String):
nacos.core.auth.plugin.nacos.token.secret.key= [建议50位以上base64编码]
相关推荐
赖small强2 分钟前
【Linux C/C++ 开发】 GCC 编译过程深度解析指南
linux·c语言·c++·预处理·链接·编译·编译过程
做人不要太理性7 分钟前
【Linux系统】ext2文件系统
大数据·linux·操作系统·文件系统
保持低旋律节奏16 分钟前
linux——软件包、yum 安装和卸载
linux·运维·服务器
莫道桑榆晚丶23 分钟前
Linux系统编程--------MP3项目实战
linux·学习
深圳市恒讯科技26 分钟前
美国服务器备份策略:快照、异地备份与恢复演练指南
运维·服务器·github
翼龙云_cloud37 分钟前
阿里云渠道商:无影云电脑怎么使用?
运维·服务器·阿里云·云计算·电脑
小oo呆39 分钟前
【学习心得】Python好库推荐——pipx
linux·开发语言·python
龙吟游戏39 分钟前
Ubuntu 25.10桌面版安装
linux·运维·ubuntu
筑梦之路44 分钟前
centos 7 grub加密 —— 筑梦之路
linux·运维·centos
AI科技星1 小时前
时空运动的几何约束:张祥前统一场论中圆柱螺旋运动光速不变性的严格数学证明与物理诠释
服务器·数据结构·人工智能·python·科技·算法·生活