Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on CentOS 7 #7

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

oleg-jukovec
Copy link
Collaborator

@oleg-jukovec oleg-jukovec commented Jul 7, 2022

CentOS 7 has an old OpenSSL version 1.0.2. We can provide support for it which was broken by our patches.

How-to reproduce the problems:

  1. Download and install OpenSSL 1.0.2:
cd /tmp/
wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz
tar -xvf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l/
./config --prefix=/tmp/openssl/ && make && make install
  1. Configure CGO_CFLAGS && CGO_LDFLAGS with the OpenSSL prefix:
export CGO_LDFLAGS="-L/tmp/openssl/lib"
export CGO_CFLAGS="-Wno-deprecated-declarations -I/tmp/openssl/include"
  1. Try to build tests:
go test -c .

The patch fixes build with OpenSSL < 1.1.1:
./ctx.go:372:28: could not determine kind of name for C.TLS1_3_VERSION
The setter functions were added in OpenSSL 1.1.0 [1]. The patch fixes
compilation for previous versions:

/usr/bin/ld: $WORK/b079/_x030.o: in function `X_SSL_CTX_set_min_proto_version':
./shim.c:479: undefined reference to `SSL_CTX_set_min_proto_version'
/usr/bin/ld: $WORK/b079/_x030.o: in function `X_SSL_CTX_set_max_proto_version':
./shim.c:483: undefined reference to `SSL_CTX_set_max_proto_version'

1. https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_min_proto_version.html
@oleg-jukovec oleg-jukovec requested review from vr009 and AnaNek July 7, 2022 07:49
@oleg-jukovec oleg-jukovec changed the title Fix build under CentOS 7 Fix build on CentOS 7 Jul 7, 2022
@oleg-jukovec oleg-jukovec requested review from vr009 and removed request for vr009 July 8, 2022 12:17
@oleg-jukovec oleg-jukovec merged commit d93c1ef into v0.0.7-24-g0fadeb4-tarantool Jul 11, 2022
@oleg-jukovec oleg-jukovec deleted the oleg-jukovec/fix-1.0-build branch July 11, 2022 09:45
oleg-jukovec added a commit to tarantool/go-tarantool that referenced this pull request Jul 11, 2022
It fixes build with OpenSSL < 1.1.1 [1] on CetnOS 7.

1. tarantool/go-openssl#7
oleg-jukovec added a commit to tarantool/go-tarantool that referenced this pull request Jul 11, 2022
The patch fixes build with OpenSSL < 1.1.1 [1] on CetnOS 7.

1. tarantool/go-openssl#7
oleg-jukovec added a commit to tarantool/go-tarantool that referenced this pull request Jul 12, 2022
The patch fixes build with OpenSSL < 1.1.1 [1] on CetnOS 7.

1. tarantool/go-openssl#7
oleg-jukovec added a commit that referenced this pull request Feb 8, 2024
Overview

    The first release with a number of fixes. Since `libp2p/openssl`
    is not supported any more we need to support our version for usage
    in the Golang connector `tarantool/go-tarantool`.

New features

    DialContext function (#10).

Bugfixes

     Build by Golang 1.13 (#6).

     Build with OpenSSL < 1.1.1 (#7).

     Build on macOS as a static library (#8).

     Build on macOS with Apple M1 (#8).

     Random errors in the code caused by an invalid OpenSSL error
     handling in LoadPrivateKeyFromPEM,
     LoadPrivateKeyFromPEMWithPassword,
     LoadPrivateKeyFromDER and LoadPublicKeyFromPEM (#9).
@oleg-jukovec oleg-jukovec mentioned this pull request Feb 8, 2024
oleg-jukovec added a commit that referenced this pull request Feb 8, 2024
Overview

    The first release with a number of fixes. Since `libp2p/openssl`
    is not supported any more we need to support our version for usage
    in the Golang connector `tarantool/go-tarantool`.

    See releases of `libp2p/openssl`[1] for previous changes history.

New features

    DialContext function (#10).

Bugfixes

     Build by Golang 1.13 (#6).

     Build with OpenSSL < 1.1.1 (#7).

     Build on macOS as a static library (#8).

     Build on macOS with Apple M1 (#8).

     Random errors in the code caused by an invalid OpenSSL error
     handling in LoadPrivateKeyFromPEM,
     LoadPrivateKeyFromPEMWithPassword,
     LoadPrivateKeyFromDER and LoadPublicKeyFromPEM (#9).

1. https://github.com/libp2p/go-openssl/releases
oleg-jukovec added a commit that referenced this pull request Feb 8, 2024
Overview

    The first release with a number of fixes. Since `libp2p/openssl`
    is not supported any more we need to support our version for usage
    in the Golang connector `tarantool/go-tarantool`.

    See releases of `libp2p/openssl`[1] for previous changes history.

New features

    DialContext function (#10).

Bugfixes

     Build by Golang 1.13 (#6).

     Build with OpenSSL < 1.1.1 (#7).

     Build on macOS as a static library (#8).

     Build on macOS with Apple M1 (#8).

     Random errors in the code caused by an invalid OpenSSL error
     handling in LoadPrivateKeyFromPEM,
     LoadPrivateKeyFromPEMWithPassword,
     LoadPrivateKeyFromDER and LoadPublicKeyFromPEM (#9).

1. https://github.com/libp2p/go-openssl/releases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants