天天看点

Jenkins+GitHub报错hudson.plugins.git.GitException: Failed to fetch from GitHub 443

偶然?总是?

在配置 源码管理的时候

使用https 进行代码的下载

配置的是用户名和密码

但是在执行构建的时候,总是会报错 443,但是偶尔也会有几次成功下载的,所以就很奇怪!!!!!!!!!!

fatal: unable to access 'https://github.com/xxx': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443      
Jenkins+GitHub报错hudson.plugins.git.GitException: Failed to fetch from GitHub 443

永久解决:配置SSH

使用Docker安装的Jenkins

!!! 非docker安装的,忽略 第一步:进入容器

1. 进入容器

[root@iZ2zeblcb2evknzc1xbhunZ ~]# docker exec -it 容器ID /bin/bash      

2. 生成密钥

bash-5.1# ssh-keygen -t rsa -b 4096 -C "GitHub邮箱"      
Jenkins+GitHub报错hudson.plugins.git.GitException: Failed to fetch from GitHub 443

3. 查看公钥并配置GitHub

查看

cat /root/.ssh/id_rsa.pub      
Jenkins+GitHub报错hudson.plugins.git.GitException: Failed to fetch from GitHub 443

GitHub配置

https://github.com/settings/ssh/new      
Jenkins+GitHub报错hudson.plugins.git.GitException: Failed to fetch from GitHub 443

查看私钥并配置项目

查看私钥

bash-5.1# cat /root/.ssh/id_rsa      

使用[email protected] 进行管理

Jenkins+GitHub报错hudson.plugins.git.GitException: Failed to fetch from GitHub 443

添加私钥凭证

Jenkins+GitHub报错hudson.plugins.git.GitException: Failed to fetch from GitHub 443

继续阅读