김보안의 블로깅
  • 🏠 Home
  • 📚 Project
    • Blockchain
      • 🎦 PickMe
      • 🎦 IoTC
      • 🎦 Blackchain
      • 📃 Gemology
      • 🎦 PickMe
      • 🎦 PickMe
    • AI
      • 👋 A.I. Dream Reader
      • 🎦 A.I. Dream Reader
    • Security
      • 🎦 SNAC
    • Education
      • 🎦 Smart Lecture
  • 🤸‍♂ Hobby
    • Music
      • Violin
      • Guitar
      • Piano
      • Drum
    • Flower
      • Flower Certificate
    • Sport
      • Ski
      • Skateboard
      • Golf
      • Boxing
레이블이 Bash인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Bash인 게시물을 표시합니다. 모든 게시물 표시

2019년 3월 21일 목요일

회사 프록시와 인증서에 고통받는 그대를 위한 글 (Bash, Gradle, Python, wget, nodejs(npm), apt-get, cURL, git, yarn, androidStudio)

 SecureKim     오후 8:36     기업, 프록시, 회사, android studio, apt-get, Bash, cURL, git, Gradle, Node.js, npm, proxy, wget, yarn     20 comments   


대기업에 입사하면 장단점이 있는데,

단점 중에 하나가 회사에서 프록시를 사용하여 트래픽 감시를 하므로 프록시 설정을 해주어야 한다는 점 입니다.

특히, 회사에서는 https 트래픽도 감시를 하므로 인증서도 설정해 주어야 합니다.

그런데 문제는, 각 프로그램마다 또 인증서와 프록시 설정을 따로 해줘야 하는 경우가 많다는 것입니다.

그래서 항상 설정 할 때마다 고통을 받고는 하는데요,

특히 입사 초반에는 특별한 이유 없이 안되는 것처럼 느껴져 시간 낭비와 짜증을 불러 일으키곤 합니다.


각 프로그램별 정리를 해 보았습니다.

SERVER 는 프록시 서버 + 포트
CERT 는 인증서 명을 뜻합니다.

strict ssl false 어쩌고 하는 옵션은 모두 인증서 검사를 안하겠다는 것이며,
MITM 의 위험을 감수한다는 뜻입니다. (어차피 프록시 서버에서 MITM 할거지만..)

기본적으로 우분투 대상이며, 오타가 있을 수 있으니 유의하시기 바랍니다.


** Bash (Lin)

sudo vi /root/.bashrc
export http_proxy="SERVER"
export https_proxy="SERVER"
export ftp_proxy="SERVER"

sudo mkdir /usr/share/ca-certificates/extra
sudo cp CERT /usr/share/ca-certificates/extra/CERT
sudo dpkg-reconfigure ca-certificates

cat CERT >> /etc/ssl/certs/ca-certificates.crt


** Gradle (WIN)

C:\Users\YOURID\.gradle\gradle.properties 생성

systemProp.proxySet="true"
systemProp.http.keepAlive="true"
systemProp.http.proxyHost=SERVERHOST
systemProp.http.proxyPort=SERVERPORT

systemProp.https.keepAlive="true"
systemProp.https.proxyHost=SERVERHOST
systemProp.https.proxyPort=SERVERPORT
systemProp.https.proxyUser=USERNAME
systemProp.https.proxyPassword=PASSWORD
systemProp.https.nonProxyHosts="local.net|some.host.com"

keytool -importcert -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -storepass changeit -trustcacerts -alias "My PROXY" -file CERT


** Python (Win)

https_proxy 환경 변수에 프록시 서버 주소 설정
PIP_CERT 환경 변수에 인증서 설정

잘 안되는 경우
pip --cert CERT install <원하는 패키지>



** wget (Lin)

vi ~/.wgetrc
use_proxy=yes
http_proxy=SERVER
https_proxy=SERVER
ca_certificate=CERT


** nodejs

npm config set https-proxy SERVER --global
npm config set http-proxy SERVER --global
npm config set cafile CERT

그래도 잘 안될 땐 눈물을 머금고
npm config set strict-ssl false --global
npm config set registry http://registry.npmjs.org/ --global

윈도우에서 에러 날때 :
VCTargetsPath 환경변수에 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140
npm install java

** apt-get (Lin)

sudo vi /etc/apt/apt.conf
Acquire::http::Proxy "SERVER";
Acquire::https::Proxy "SERVER";

우분투에서 뭔가 잘 안된다면 kr.archive.ubuntu 를 ftp.daum.net 으로 변경해 봅시다.
sudo vi /etc/apt/sources.list
:1,$ s/kr.archive.ubuntu.com/ftp.daum.net/g

sudo apt-get update

** cURL (Lin)

sudo vi /etc/ssl/certs/ca-certificates.crt 파일에
CERT 내용 add ( cat CERT >> /etc/ssl/certs/ca-certificates.crt )

** git

sudo git config --global http.proxy SERVER
sudo git config --system http.sslcainfo CERT


** npm

npm config set proxy SERVER
npm config set https-proxy SERVER
npm config set cafile CERT

npm --add-python-to-path='true' --debug install --global windows-build-tools

그래도 잘 안되면 눈물을 머금고
npm config set "strict-ssl" false -g

** yarn

yarn config set proxy SERVER
yarn config set https-proxy SERVER

그래도 잘 안되면 눈물을 머금고
yarn config set "strict-ssl" false -g
set NODE_TLS_REJECT_UNAUTHORIZED=0
export NODE_TLS_REJECT_UNAUTHORIZED=0

** Android Studio (Win)

기본적으로 프록시 설정이 쉽게 잘 되어 있습니다만... 인증서 설정은 아니죠
C:\Program Files\Android\Android Studio\jre\bin>keytool.exe -import -alias proxycert -file CERT -keystore ../jre/lib/security/cacerts






Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
이전 게시물 홈

페이지

  • 홈
  • Hobby

Categories

  • AI
  • AWS
  • Blockchain
  • Hardware
  • Javascript
  • Node.js
  • Plasma
  • Security
  • Study
  • Video
  • android
  • mysql
  • review
  • windows

Popular Posts

  • 블랙보드 강의 녹화 영상 다운로드 가능한 방법 (노설치)
    별도의 설치도 필요 없고 아주 쉽습니다. 구글 크롬브라우저 에서 블랙보드 녹화 영상에  다운로드 가능한 메뉴가 나오게 하는 코드입니다.  먼저 블랙보드 강의자료에 입장하고, 재생 버튼을 클릭 하지 않은 상태로 F12 를 입력합니다. 재생을 클릭하지 마...
  • 회사 프록시와 인증서에 고통받는 그대를 위한 글 (Bash, Gradle, Python, wget, nodejs(npm), apt-get, cURL, git, yarn, androidStudio)
    대기업에 입사하면 장단점이 있는데, 단점 중에 하나가 회사에서 프록시를 사용하여 트래픽 감시를 하므로 프록시 설정을 해주어야 한다는 점 입니다. 특히, 회사에서는 https 트래픽도 감시를 하므로 인증서도 설정해 주어야 합니다. 그런데 문...
  • Termux 로 안드로이드에 우분투(GUI)와 VSCode설치하기
      많은 글들이 있지만 뭔가 대부분 잘 안됐다. 이번 기회에 정리한다. 0. 먼저 Termux와 Remote Desktop Manager를 설치한다. Remote Desktop Manager 대신 아래도 나쁘지 않다. 화면이 작지만 마우스 스크롤이나 ...

Blog Archive

  • ▼  2026 (2)
    • ▼  2월 (2)
      • 태블릿에서 양자내성암호(격자암호) 돌려보기
      • 양자컴퓨터와 보안 위협 (쇼어 알고리즘)
  • ►  2025 (3)
    • ►  9월 (1)
    • ►  8월 (1)
    • ►  7월 (1)
  • ►  2024 (2)
    • ►  11월 (2)
  • ►  2023 (2)
    • ►  10월 (1)
    • ►  1월 (1)
  • ►  2022 (10)
    • ►  12월 (1)
    • ►  11월 (3)
    • ►  9월 (1)
    • ►  8월 (1)
    • ►  6월 (2)
    • ►  3월 (2)
  • ►  2021 (9)
    • ►  12월 (3)
    • ►  11월 (1)
    • ►  6월 (1)
    • ►  5월 (2)
    • ►  4월 (2)
  • ►  2020 (12)
    • ►  10월 (1)
    • ►  9월 (2)
    • ►  7월 (1)
    • ►  6월 (1)
    • ►  5월 (5)
    • ►  4월 (1)
    • ►  2월 (1)
  • ►  2019 (14)
    • ►  10월 (2)
    • ►  7월 (1)
    • ►  3월 (4)
    • ►  2월 (2)
    • ►  1월 (5)
  • ►  2018 (14)
    • ►  12월 (2)
    • ►  11월 (4)
    • ►  10월 (1)
    • ►  8월 (2)
    • ►  5월 (4)
    • ►  1월 (1)
  • ►  2017 (12)
    • ►  10월 (2)
    • ►  9월 (9)
    • ►  5월 (1)
  • ►  2016 (8)
    • ►  10월 (2)
    • ►  8월 (1)
    • ►  6월 (1)
    • ►  1월 (4)
  • ►  2015 (6)
    • ►  12월 (3)
    • ►  10월 (1)
    • ►  6월 (1)
    • ►  5월 (1)
  • ►  2014 (10)
    • ►  11월 (1)
    • ►  9월 (1)
    • ►  7월 (1)
    • ►  6월 (1)
    • ►  5월 (3)
    • ►  4월 (1)
    • ►  3월 (2)
  • ►  2013 (28)
    • ►  12월 (3)
    • ►  11월 (6)
    • ►  10월 (6)
    • ►  9월 (6)
    • ►  8월 (1)
    • ►  7월 (3)
    • ►  6월 (3)

구독

글
Atom
글
전체 댓글
Atom
전체 댓글

로드 중입니다...

각오

직접 해보지 않은 것은 포스팅 하지 않겠습니다.

Copyright © 김보안의 블로깅 | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates