设为首页 收藏本站
查看: 2306|回复: 0

[经验分享] Puppet SSL证书协商错误 记录

[复制链接]
累计签到:2 天
连续签到:1 天
发表于 2016-1-28 08:49:22 | 显示全部楼层 |阅读模式
今天agent在拉取配置清单的时候报错, 错误如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[iyunv@server214 ~]#puppet agent -t --server server212.localdomain
Info: Creating a new SSL key for server214.localdomain
Info: Caching certificate for server214.localdomain
Error: Could not request certificate: The certificate retrieved from the master does not match the agent's private key.
Certificate fingerprint: B1:A2:9F:C2:F7:31:14:B9:10:44:CF:7F:A4:A3:DF:6F:7D:84:85:51:CE:EB:D0:E0:07:90:D0:1A:52:57:4A:05
To fix this, remove the certificate from both the master and the agent and then start a puppet run, which will automatically regenerate a certficate.
On the master:
  puppet cert clean server214.localdomain
On the agent:
  1a. On most platforms: find /var/lib/puppet/ssl -name server214.localdomain.pem -delete
  1b. On Windows: del "/var/lib/puppet/ssl/server214.localdomain.pem" /f
  2. puppet agent -t

Exiting; failed to retrieve certificate and waitforcert is disabled




根据提示在master端清除该 agent的证书信息
然后在agent端 查找自己颁发的证书,并删除。

再试试:
1
2
3
4
5
6
7
8
9
[iyunv@server214 ~]#find /var/lib/puppet/ssl -name server214.localdomain.pem -delete
[iyunv@server214 ~]#puppet agent -t --server server212.localdomain
Info: Creating a new SSL key for server214.localdomain
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for server214.localdomain
Info: Certificate Request fingerprint (SHA256): 1B:B5:6F:F2:C3:D2:BF:22:EA:73:A7:54:3F:D6:41:25:07:B0:36:75:72:11:AC:41:91:A0:C3:19:D9:7C:7B:77
Info: Caching certificate for server214.localdomain
Error: Could not request certificate: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [self signed certificate in certificate chain for /CN=Puppet CA: server212.localdomain]
Exiting; failed to retrieve certificate and waitforcert is disabled




结果 还在报错,Error: Could not request certificate: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [self signed certificate in certificate chain for /CN=Puppet CA: server212.localdomain]

查了一下,问题应该是出在agent端,于是在agent端删除整个ssl目录
1
# rm -rf /var/lib/puppet/ssl/



然后,再去master端确认下 无问题agent端的证书信息
1
# puppet cert clean server214.localdomain





然后再重新向 master申请证书签发
1
2
3
4
5
6
7
8
[iyunv@server214 ~]#puppet agent -t --server server212.localdomain
Info: Creating a new SSL key for server214.localdomain
Info: Caching certificate for ca
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for server214.localdomain
Info: Certificate Request fingerprint (SHA256): EC:E9:96:05:3F:17:71:69:4A:13:46:4B:71:BD:4D:FD:90:9C:BF:20:0B:E4:0E:95:06:C8:BF:7A:59:DC:77:F4
Info: Caching certificate for ca
Exiting; no certificate found and waitforcert is disabled




到master端 签证书,然后在agent执行正常的配置清单获取
1
2
3
4
5
6
7
8
[iyunv@server214 ~]#puppet agent -t --server server212.localdomain
Info: Caching certificate for server214.localdomain
Info: Caching certificate_revocation_list for ca
Info: Caching certificate for server214.localdomain
Info: Caching catalog for server214.localdomain
Info: Applying configuration version '1453901147'
Notice: /Stage[first]/Initialization::Kernel_sysctl_config/File[transfer_sysctl.conf]/content:
--- /etc/sysctl.conf    2014-10-16 22:53:31.000000000 +0800



正常了。  
我这台agent端做过实验,里面已经整的乱七八糟了,索性就把所有ssl/目录下的文件删除就ok。

记录下。



又遇到错误

1
2
3
4
5
6
7
8
9
10
11
[iyunv@server178 ~]# puppet agent --test --server puppet_master
Info: Caching catalog for server178
Info: Applying configuration version '1453903372'
Error: /Stage[first]/Initialization::Kernel_sysctl_config/File[transfer_sysctl.conf]: Could not evaluate: Could not retrieve file metadata for puppet:///file_initialization/kernel_sysctl.conf: Error 400 on SERVER: Not authorized to call find on /file_metadata/file_initialization/kernel_sysctl.conf with {:links=>"manage", :source_permissions=>"use"}
Notice: /Stage[first]/Initialization::Kernel_selinux_disabled/Exec[permissive_selinux]/returns: executed successfully
Notice: /Stage[first]/Initialization::Kernel_sysctl_config/Exec[accept_sysctl.conf]: Dependency File[transfer_sysctl.conf] has failures: true
Warning: /Stage[first]/Initialization::Kernel_sysctl_config/Exec[accept_sysctl.conf]: Skipping because of failed dependencies
Error: /Stage[first]/Initialization::Kernel_selinux_disabled/File[transfer_selinux_config]: Could not evaluate: Could not retrieve file metadata for puppet:///file_initialization/selinux_config_file: Error 400 on SERVER: Not authorized to call find on /file_metadata/file_initialization/selinux_config_file with {:links=>"manage", :source_permissions=>"use"}
Notice: /Stage[first]/Initialization::Kernel_selinux_disabled/Notify[selinux_config Done]: Dependency File[transfer_selinux_config] has failures: true
Warning: /Stage[first]/Initialization::Kernel_selinux_disabled/Notify[selinux_config Done]: Skipping because of failed dependencies
Error: /Stage[first]/Initialization::Kernel_file_descriptor/File[90-nproc.conf]: Could not evaluate: Could not retrieve file metadata for puppet:///file_initialization/90-nproc.conf: Error 400 on SERVER: Not authorized to call find on /file_metadata/file_initialization/90-nproc.conf with {:links=>"manage", :source_permissions=>"use"}



重点:Not authorized to call find on /file_metadata/file_initialization/kernel_sysctl.conf
提示为授权的资源获取,那么就和 fileserver.conf 中的配置有关系了。检查里面关于特定目录的allow选项(或者临时的 * 放开全部)。


解决了。


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-170449-1-1.html 上篇帖子: 源码安装 puppet 3.8.5 下篇帖子: puppet部署与应用 记录 证书
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表