1. openSSL 사이트에 들어가서 원하는 버전을 다운로드

1.1. 다운로드 경로 : https://www.openssl.org/source/

 

[ Downloads ] - /source/index.html

Downloads The master sources are maintained in our git repository, which is accessible over the network and cloned on GitHub, at https://github.com/openssl/openssl. Bugs and pull patches (issues and pull requests) should be filed on the GitHub repo. Please

www.openssl.org

 

1.2. 원하는 버전에 tar.gz 파일이 다운로드

 

 

2. 다운로드 받은 openssl-X.X.X.tar.gz 파일을 압축 해제(openssl-3.0.13)

## openssl 3.0.13 버전 다운로드
## 형식 tar -xvf openssl-X.X.X.tar.gz
$ tar xvfz openssl-3.0.13.tar.gz

 

 

3. 압축 해체 이후, openssl-X.X.X 폴더 진입(openssl-3.0.13)

## 형식 : cd openssl-X.X.X
$ cd openssl-3.0.13;

 

 

4. openssl-X.X.X 폴더로 진입하여 ls 명령어를 입력, config 실행

4.1. 사용 가능한 패키지들 업데이트 및 필수 패키지 설치

$ sudo apt-get update;
$ sudo apt-get install build-essential -y;​

 

4.2. openssl-X.X.X 폴더 내 ls 명령어 확인

$ ~/openssl-3.0.13# ls
ACKNOWLEDGEMENTS.md  demos        ms                 README-FIPS.md
apps                 doc          NEWS.md            README.md
AUTHORS.md           engines      NOTES-ANDROID.md   README-PROVIDERS.md
build.info           e_os.h       NOTES-DJGPP.md     ssl
CHANGES.md           external     NOTES-NONSTOP.md   SUPPORT.md
config               FAQ.md       NOTES-PERL.md      test
config.com           fuzz         NOTES-UNIX.md      tools
configdata.pm        HACKING.md   NOTES-VALGRIND.md  util
configdata.pm.in     include      NOTES-VMS.md       VERSION.dat
Configurations       INSTALL.md   NOTES-WINDOWS.md   VMS
Configure            LICENSE.txt  os-dep             wycheproof
CONTRIBUTING.md      Makefile     providers
crypto               Makefile.in  README-ENGINES.md

 

4.3. openssl-X.X.X 폴더 내 config 명령어 실행

$ ./config
Configuring OpenSSL version 3.0.13 for target linux-x86_64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************

 

 

5. make 명령어를 사용해 소스를 컴파일

5.1. 컴파일(소스파일을 사용자가 실행 가능한 파일로 만들어 주는 과정) 진행(대략 5분 정도 소요)

$ make
...생략...

 

5.2. 컨파일 완료 후 실행 가능한 파일 생성 확인 → 완료 시 아래와 같이 출력

$ make
...생략...
make[1]: Leaving directory '/home/~/openssl-3.0.13'

 

 

6. 실행 가능한 파일 생성 후 설치 진행

$ make install
...생략...
install doc/html/man7/provider-rand.html -> /usr/local/share/doc/openssl/html/man7/provider-rand.html
install doc/html/man7/provider-signature.html -> /usr/local/share/doc/openssl/html/man7/provider-signature.html
install doc/html/man7/provider-storemgmt.html -> /usr/local/share/doc/openssl/html/man7/provider-storemgmt.html
install doc/html/man7/provider.html -> /usr/local/share/doc/openssl/html/man7/provider.html
install doc/html/man7/proxy-certificates.html -> /usr/local/share/doc/openssl/html/man7/proxy-certificates.html
install doc/html/man7/ssl.html -> /usr/local/share/doc/openssl/html/man7/ssl.html
install doc/html/man7/x509.html -> /usr/local/share/doc/openssl/html/man7/x509.html



7. 설치한 openssl 명령어 버전 확인 후 조치

7.1. openssl 명령어 버전 조회 시 에러 메시지 발생

$ openssl version
openssl: /lib/x86_64-linux-gnu/libcrypto.so.3: version `OPENSSL_3.0.9' not found (required by openssl)

 

7.2. 조치 사항

$ echo "/usr/local/lib64" > /etc/ld.so.conf.d/openssl-3-0-13.conf
$ openssl version
OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)

 

 

참고 자료 : [Linux] OpenSSL을 Ubuntu에서 설치하고 업데이트하는 방법 — hyun 공부 학습 공간 (tistory.com)

 

 

+ Recent posts