ubuntu - Unable to get maven to download from HTTPS URLs behind proxy -
from dependencies specify in pom.xml
, ones use http urls gets downloaded ones use https urls fails saying:
severe: proxy authentication error: credentials cannot used ntlm authentication: org.apache.maven.wagon.providers.http.httpclient.auth.usernamepasswordcredentials
here contents of settings.xml
:
<?xml version="1.0" encoding="utf-8"?> <settings xmlns="http://maven.apache.org/settings/1.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/settings/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <plugingroups /> <proxies> <proxy> <id>proxy1</id> <active>true</active> <protocol>http</protocol> <host>proxy.mycompany.com</host> <port>6050</port> <username>domain\username</username> <password>password</password> <nonproxyhosts></nonproxyhosts> </proxy> <proxy> <id>proxy2</id> <active>true</active> <protocol>https</protocol> <host>proxy.mycompany.com</host> <port>6050</port> <username>domain\username</username> <password>password</password> <nonproxyhosts></nonproxyhosts> </proxy> </proxies> <servers> </servers> <mirrors> </mirrors> <profiles> <profile> <id>centralrepo</id> <repositories> <repository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>fortytwo</id> <name>fortytwo.net maven repository</name> <url>http://fortytwo.net/maven2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>javanet</id> <name>java.net maven repository</name> <url>http://download.java.net/maven/2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>scala-tools.org</id> <name>scala-tools maven2 repository</name> <url>http://scala-tools.org/repo-releases</url> </repository> </repositories> <pluginrepositories> <pluginrepository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginrepository> <pluginrepository> <id>scala-tools.org</id> <name>scala-tools maven2 repository</name> <url>http://scala-tools.org/repo-releases</url> </pluginrepository> </pluginrepositories> </profile> </profiles> </settings>
i googled , found people suggest use cntlm. so, installed cntlm , edited /etc/cntlm.conf
file following:
# # cntlm authentication proxy configuration # # note: values parsed literally, not escape spaces, # not quote. use 0600 perms if use plaintext password. # username username domain domain password password # note: use plaintext password @ own risk # use hashes instead. can use "cntlm -m" , "cntlm -h" # command sequence right config environment. # see cntlm man page # example secure config shown below. # passlm 1ad35398be6565ddb5c4ef70c0593492 # passnt 77b9081511704ee852f94227cf48a793 ### user 'testuser', domain 'corp-uk' # passntlmv2 d5826e9c665c37c80b53397d5c07bbcb # specify netbios hostname cntlm send parent # proxies. value auto-guessed. # # workstation netbios_hostname # list of parent proxies use. more proxies can defined # 1 per line in format <proxy_ip>:<proxy_port> # proxy proxy.mycompany.com:6050 # list addresses not want pass parent proxies # * , ? wildcards can used # noproxy localhost, 127.0.0.*, 10.*, 192.168.* # specify port cntlm listen on # can bind cntlm specific interface specifying # appropriate ip address in format <local_ip>:<local_port> # cntlm listens on 127.0.0.1:3128 default # listen 3128 # if wish use socks5 proxy feature well, uncomment # following option. can used several times # have socks5 on more 1 port or on different network # interfaces (specify explicit source address that). # # warning: service accepts requests, unless use # socks5user , make authentication mandatory. socks5user # can used repeatedly whole bunch of individual accounts. # #socks5proxy 8010 #socks5user dave:password # use -m first detect best ntlm settings proxy. # default use secure hash, ntlmv2, not # available older stuff. # # example universal setup known man, # uses weakest hash ever. won't have it's usage on # conscience. :) really, try -m first. # #auth lm #flags 0x06820000 # enable allow access other computers # #gateway yes # useful in gateway mode allow/restrict ips # specifiy individual ips or subnets 1 rule per line. # #allow 127.0.0.1 #deny 0/0 # gfi webmonitor-handling plugin parameters, disabled default # #isascannersize 1024 #isascanneragent wget/ #isascanneragent apt-http/ #isascanneragent yum/ # headers should replaced if present in request # #header user-agent: mozilla/4.0 (compatible; msie 5.5; windows 98) # tunnels mapping local port machine behind proxy. # format <local_port>:<remote_host>:<remote_port> # #tunnel 11443:remote.com:443
when try test cntlm sudo cntlm -v -i -m http://google.com
, following:
reading proxy auth response... head: http/1.1 407 proxy authorization required . . . head: http/1.1 407 proxy authorization required credentials rejected
i sure credentials correct maven able download dependencies http urls.
about month ago, company changed ssl certificates https proxy , ever since, have been getting error.
help !
solution problem https_proxy environment variable cntlm authentication proxy. please find here answer! contact me if need kind of help!
Comments
Post a Comment