-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3d35d9
commit dc65023
Showing
19 changed files
with
217 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.. _git-openssl: | ||
|
||
==================== | ||
使用OpenSSL的git | ||
==================== | ||
|
||
当我采用 :ref:`git_proxy` 在 :ref:`squid_socks_peer` 后面通过代理访问Android源代码仓库 :ref:`build_lineageos_20_pixel_4` 遇到一个持续报错: | ||
|
||
.. literalinclude:: git-openssl/git_tls_connection_err | ||
:caption: git HTTPS代理访问 ``googlesource`` 报错 TLS连接中断 | ||
:emphasize-lines: 4 | ||
|
||
这个问题看起来是Ubuntu ``gnutls_handshake`` 解决方案的一个问题,需要通过重新编译 ``git`` 来解决(也就是采用 ``libcurl-openssl-dev`` 替代 ``gnutls`` ) | ||
|
||
- 安装编译环境: | ||
|
||
.. literalinclude:: git-openssl/gt_build_dependencies | ||
:caption: 安装git编译依赖环境 | ||
|
||
- 修改 ``/etc/apt/sources.list`` 将源代码仓库激活(默认没有激活或配置): | ||
|
||
.. literalinclude:: git-openssl/sources.list | ||
:caption: 配置apt源代码源 | ||
:emphasize-lines: 2,4,6 | ||
|
||
- 更新仓库索引然后安装 ``git`` 源代码: | ||
|
||
.. literalinclude:: git-openssl/apt_source_git | ||
:caption: 更新仓库索引然后安装 ``git`` 源代码 | ||
|
||
- 安装 ``libcurl`` : | ||
|
||
.. literalinclude:: git-openssl/apt_libcurl | ||
:caption: 安装 libcurl | ||
|
||
- 进入git源代码目录,修改2个文件,然后重新编译git: | ||
|
||
.. literalinclude:: git-openssl/recompile_git_with_openssl | ||
:caption: 修订配置后重新编译git with openssl | ||
|
||
- 然后进入上级目录安装编译后的deb包: | ||
|
||
.. literalinclude:: git-openssl/pkg_install_git_with_openssl | ||
:caption: 安装编译后的deb包 | ||
|
||
安装输出信息: | ||
|
||
.. literalinclude:: git-openssl/pkg_install_git_with_openssl_output | ||
:caption: 安装编译后的git包输出信息 | ||
|
||
参考 | ||
====== | ||
|
||
- `GnuTLS recv error (-110): The TLS connection was non-properly terminated <https://stackoverflow.com/questions/52529639/gnutls-recv-error-110-the-tls-connection-was-non-properly-terminated>`_ | ||
- `git-openssl-shellscript (GitHub) <https://github.com/niko-dunixi/git-openssl-shellscript>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sudo apt-get install libcurl4-openssl-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sudo apt update | ||
mkdir ~/git-rectify | ||
cd ~/git-rectify | ||
|
||
# 获取git源代码 | ||
sudo apt-get source git | ||
|
||
# 安装git编译依赖 | ||
sudo apt-get build-dep git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
platform/external/ppp: | ||
fatal: unable to access 'https://android.googlesource.com/platform/external/ppp/': gnutls_handshake() failed: The TLS connection was non-properly terminated. | ||
platform/external/ppp: sleeping 4.0 seconds before retrying | ||
fatal: unable to access 'https://android.googlesource.com/platform/external/ppp/': GnuTLS recv error (-110): The TLS connection was non-properly terminated. | ||
error: Cannot fetch platform/external/rust/crates/ash from https://android.googlesource.com/platform/external/rust/crates/ash | ||
error: Cannot fetch platform/external/ppp from https://android.googlesource.com/platform/external/ppp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sudo apt-get install build-essential fakeroot dpkg-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cd .. # is in the ~/git-rectify directory | ||
sudo dpkg -i git_2.34.1-1ubuntu1.10_amd64.deb |
4 changes: 4 additions & 0 deletions
4
source/devops/git/git-openssl/pkg_install_git_with_openssl_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(Reading database ... 39077 files and directories currently installed.) | ||
Preparing to unpack git_2.34.1-1ubuntu1.10_amd64.deb ... | ||
Unpacking git (1:2.34.1-1ubuntu1.10) over (1:2.34.1-1ubuntu1.10) ... | ||
Setting up git (1:2.34.1-1ubuntu1.10) ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cd git-2.34.1 | ||
vim ./debian/control # Modify libcurl4-gnutls-dev to libcurl4-openssl-dev | ||
vim ./debian/rules # delete the entire line of TEST=test | ||
sudo dpkg-buildpackage -rfakeroot -b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
deb http://archive.ubuntu.com/ubuntu jammy main universe | ||
deb-src http://archive.ubuntu.com/ubuntu jammy main universe | ||
deb http://archive.ubuntu.com/ubuntu jammy-security main universe | ||
deb-src http://archive.ubuntu.com/ubuntu jammy-security main universe | ||
deb http://archive.ubuntu.com/ubuntu jammy-updates main universe | ||
deb-src http://archive.ubuntu.com/ubuntu jammy-updates main universe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.. _compile_curl_ssl: | ||
|
||
======================= | ||
编译OpenSSL支持的curl | ||
======================= | ||
|
||
在 :ref:`build_lineageos_20_pixel_4` 采用了自己编译的 :ref:`git-openssl` ,此时系统升级安装了 ``OpenSSL`` 的 3.0.x 版本,在 Ubuntu 22.04 LTS 上默认安装的 ``curl`` 是 ``7.81.0`` ,此时和 ``OpenSSL`` 的 3.0.x 版本一起工作会出现异常 ``unexpected eof while reading`` 报错: | ||
|
||
.. literalinclude:: compile_curl_ssl/curl_openssl_unexpected_eof_err | ||
:caption: 在 Ubuntu 22.04 LTS 默认 ``curl`` 是 ``7.81.0`` 和 ``OpenSSL`` 3.0.x 版本异常报错 | ||
:emphasize-lines: 2,4 | ||
|
||
.. note:: | ||
|
||
不过我还是不能确定是否真正解决了这个问题,看起来还是有同样的报错。翻墙网络不太稳定似乎也是有可能的 | ||
|
||
解决方法是重新编译支持OpenSSL 3.0.x的最新版本curl: | ||
|
||
.. literalinclude:: compile_curl_ssl/build_curl | ||
:caption: 编译OpenSSL支持的最新版本curl | ||
|
||
不过,此时运行curl下载https内容时候会有报错: | ||
|
||
.. literalinclude:: compile_curl_ssl/curl_ssl_err | ||
:caption: 编译后curl访问https有 ``no version information available`` 报错 | ||
|
||
这个问题参考 `libcurl.so.4 no version information available <https://serverfault.com/questions/696631/libcurl-so-4-no-version-information-available>`_ :: | ||
|
||
sudo ln -fs /usr/lib/libcurl.so.4 /usr/local/lib/ | ||
|
||
参考 | ||
======= | ||
|
||
- `OpenSSL Error messages: error:0A000126:SSL routines::unexpected eof while reading <https://stackoverflow.com/questions/72627218/openssl-error-messages-error0a000126ssl-routinesunexpected-eof-while-readin>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apt remove curl | ||
apt purge curl | ||
apt-get update | ||
apt-get install -y libssl-dev autoconf libtool make | ||
cd /usr/local/src | ||
wget https://github.com/curl/curl/releases/download/curl-8_4_0/curl-8.4.0.tar.gz | ||
tar xfz curl-8.4.0.tar.gz | ||
cd curl-8.4.0 | ||
./buildconf | ||
./configure --with-ssl | ||
make | ||
sudo make install | ||
sudo cp /usr/local/bin/curl /usr/bin/curl | ||
sudo ldconfig | ||
curl -V |
5 changes: 5 additions & 0 deletions
5
source/web/curl/compile_curl_ssl/curl_openssl_unexpected_eof_err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
platform/external/rust/crates/grpcio-sys: | ||
fatal: unable to access 'https://android.googlesource.com/platform/external/rust/crates/grpcio-sys/': OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0 | ||
platform/external/rust/crates/grpcio-sys: sleeping 4.0 seconds before retrying | ||
fatal: unable to access 'https://android.googlesource.com/platform/external/rust/crates/grpcio-sys/': error:0A000126:SSL routines::unexpected eof while reading | ||
error: Cannot fetch platform/external/rust/crates/grpcio-sys from https://android.googlesource.com/platform/external/rust/crates/grpcio-sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
platform/external/rust/crates/macaddr: | ||
/usr/lib/git-core/git-remote-https: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/lib/git-core/git-remote-https) | ||
fatal: unable to access 'https://android.googlesource.com/platform/external/rust/crates/macaddr/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to android.googlesource.com:443 | ||
platform/external/rust/crates/macaddr: sleeping 4.0 seconds before retrying |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters