How do I configure Maven to use a proxy with HTTPS resources? It seems not to work with the settings in xxx\.m2\settings.xml? (HTTP yes, but not HTTPS)
I am behind my company's squid proxy.
This took way too long to figure out, but the solution proposed here (german) works:
In your Maven installation directory, under the bin subfolder, there is an m2.conf file. Adding your proxy settings as follows works:
set https.proxyHost default myHost
set https.proxyPort default myPort
Omit the mentioned xxx\.m2\settings.xml file.
It is implied that you would also need to add your HTTP Proxy to these settings:
set http.proxyHost default myHost
set http.proxyPort default myPort
Related
I have installed Jenkins in windows
I can access Jenkins with two URLs
http://hostname:8080,
https://jenkins.domain.com
how can I block access via HTTP so that everyone can use only via HTTPS
Ps: HTTPS already configured
You can do this by setting the httpPort to -1
See the docs here https://www.jenkins.io/doc/book/installing/initial-settings/#configuring-http
How can I configure conda to use a caching proxy?
So far I have:
installed SquidMan and set its host and port to 127.0.0.1:8080.
set the network settings to proxy both http and https at this address
edited .condarc to use a proxy
I think that SquidMan is set up correctly. If I switch it off and try to browse the internet, I get an error message "The proxy server is refusing connections". This happens for both http and https websites and also if I enter an IP directly (no DNS in between).
The edited .condarc is this:
proxy_servers:
http: http://127.0.0.1:8080
https: http://127.0.0.1:8080
Those are the same addresses as in the system proxy settings - which seem to work fine for browsing.
As a test I'm cycling through
conda install python=3.6
conda install python=3.7
conda clean --all
and hoping to see very fast download speeds for those python packages.
But they are always painfully slow.
I checked the SquidMan settings. There is a "maximum object size", maybe that prevents the conda downloads from being cached. Are they too big ?
So I dialled those settings up to the max (well bigger than the conda download) and tried again. Same results.
How do I configure squidman to work with conda ?
It sounds like you likely have configured everything properly for proxying traffic through squid. However, conda uses https to download its packages. In a basic configuration, squid can only pass SSL connections through from the client to the server. This traffic is already encrypted, so it can not be cached. Options that you have available to you are:
Use squid's ssl bump feature to have squid decrypt and re-encrypt the data passing through it. Getting this set up is somewhat tricky because you have to generate a self-signed certificate and get it trusted by conda (using conda install --insecure might be all that is needed for conda).
Use a conda-specific proxy server. Anaconda, Inc. offers such a server as a product, so you are unlikely to find much built-in support for this in the open source conda tools. Sonatype's Nexus repository manager also claims to proxy conda repositories in its documentation.
Use conda's built-in support for local caching. Since you referenced conda clean in your question, you are aware of this cache and must have some reason for not using it. For a single machine, the conda pkgs_dir should work pretty well. For multiple machines, maybe you could get by with a network share pkgs_dir or copying all the .tar.bz2 and .conda files from a local machine into the pkgs_dir for each machine.
Add a second layer of proxying. conda allows you to specify channels with an http protocol. You could set up a proxy server that accepts http requests and passes them on as https requests. You could put your squid caching proxy in front of this http-https proxy. This way, squid will see plain http traffic that it can inspect and cache, and you can still access https only conda repositories. As an example, with nginx, you could do this with a simple conf file like:
server {
listen 80;
server_name localhost 127.0.0.1;
location / {
proxy_pass https://repo.anaconda.com/;
}
}
When jcenter is not accessible without proxy server, to resolve dependencies, and i want to use socks instead of http proxy, how i can use it in commanad line?
I know how to use http proxy:
-Dhttp.proxyHost=yourProxy -Dhttp.proxyPort=yourPort
-Dhttp.proxyUser=usernameProxy -Dhttp.proxyPassword=yourPassoword
I found answer, here you can use:
./gradlew -DsocksProxyHost=yourHost
-DsocksProxyPort=yourHostPort your-command
using above you can set socks host and port.
Gradle only documents about how to use HTTP(s) proxy, however in the ant source code it mentions, there is enough information about how to setup the SOCKS proxy.
Add the following two lines to the gradle.properties configuration file and you are done.
systemProp.socksProxyHost=your socks proxy ip
systemProp.socksProxyPort=your socks proxy port
The format of SOCKS configuration names (socksProxyHost and socksProxyPort) differs from HTTP proxy host and port configurations (http.proxyHost and http.proxyPort).
Refering to https://discuss.gradle.org/t/how-can-i-set-gradle-proxy-to-socks/15508
In the Project window change from Android to Project scope.
Then open up gradle.properties and add this line:
org.gradle.jvmargs=-DsocksProxyHost=yourHostIP -DsocksProxyPort=yourHostPort
Sync project.
i might be a little late but i found out that in ubuntu/Linux the proxy settings are cached in ~/.gradle/gradle.properties and I also found out that this gradle.properties is different from the one in your app inside android studio.
so you need to edit the credentials in there.
do a vim ~/.gradle/gradle.properties and edit the credentials there.
in my case i was using a socks proxy so i commented out all the http and https proxy hosts and ports and added one for socks. it looked like this
`systemProp.socks5ProxyHost=127.0.0.1
systemProp.socks5ProxyPort=1080`
i was able to sync gradle afterwards.
Adding a proxy section to my ~/.hgrc file doesn't seem to work, nor does
setting the proxy on the command line; e.g.
$ hg --config=http_proxy.host=http://127.0.0.1:8181 incoming
The proxy section in my ~/.hgrc file looks like:
[http_proxy]
host=http://localhost:8181
Instead, I get a not so informative response printed to stderr:
abort: error: ''
After some investigation, (adding --debug --traceback) I found this error
happens in the keepalive.py file of one of the underlying python library files.
I have Firefox/foxyproxy set up to use this same proxy, and everything works
fine - the port number [and host] is correct.
After a few minutes I realised my proxy is set up as a socks proxy, and that
mercurial doesn't work with socks proxies. The fact that the section heading is
http_proxy was the give-away hint.
I installed polipo, set it to use the socks proxy as it's parent, and
configured mercurial in the ~/.hgrc file to use this proxy instead.
Everything is working nicely now. (And I've also set firefox to use it instead
as it caches files as required too).
I cannot get the proxy configuration to work for SonarQube 4.0 so that I can install plugins.
When i open http://localhost:9000/updatecenter/available it displays the error: "Not connected to update center. Please check your internet connection and logs."
In sonar.log I read: "org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://update.sonarsource.org/update-center.properties]. Response code: 403"
In sonar.properties I configured it with the same proxy which I use for other programs:
sonar.updatecenter.activate=true
http.proxyHost=<host>
http.proxyPort=<port>
http.proxyUser=<username>
http.proxyPassword=<password>
I tried the same to configure in wrapper.properties, but it didn't work either by the way.
For the proxy host I tried the short and the full name. For the username I tried just the username and with <DOMAINNAME>\<username> and <DOMAINNAME>\\<username>.
Nothing of it worked. Any ideas?
My proxy configuration works and looks the following way:
http.proxyHost=proxy.domain.de
http.proxyPort=8888
Note that there is no "http://" or anything else before the URL.
Also, I do not use proxy authentication, so I left "proxyUser" and "proxyPassword" commented out.
For those running SonarQube in Docker, I had no luck with any suggestion mentioned here. But I found following solution that worked for me (here):
docker run -d sonarqube -Dhttp.proxyHost=<myproxy.url.com> -Dhttp.proxyPort=<port>
and equivalent of this in a docker-compose notation:
services:
sonarqube:
image: sonarqube
command: -Dhttp.proxyHost=<myproxy.url.com> -Dhttp.proxyPort=<port>
Just an information: I had this problem also.
I can see the PlugIns but cannot download it. The problem is, you have to add this line into your sonar.properties, for the https:
# https-proxy
sonar.web.javaAdditionalOpts=-Dhttps.proxyHost=xxxxx -Dhttps.proxyPort=xxxx -Dhttps.proxyUser=xxxx -Dhttps.proxyPassword=xxxx
I used the official documentation and it works:
Using the Update Center behind a Proxy
http.proxyHost=<your.proxy.host>
http.proxyPort=<yout.proxy.port>
Regards,
At sonar.properties set the proxy without "http://", only http.proxyHost=myproxy.domain.pt
Another suggestion is to also add this lines on wrapper.conf:
wrapper.java.additional.3=-Dhttp.proxySet=true
wrapper.java.additional.4=-Dhttp.proxyHost=myproxy.domain.pt
wrapper.java.additional.5=-Dhttp.proxyPort=myproxy.port
wrapper.java.additional.6=-Dhttps.proxyHost=myproxy.domain.pt
wrapper.java.additional.7=-Dhttps.proxyPort=myproxy.port
Careful if you have a docker volume, remove it before deploy the new one with this configuration, or otherwise it will keep the original configuration
Appart from http, don't forget to set your https proxy configuration in sonar.properties (update server is behind HTTPS):
https.proxyHost=<host>
https.proxyPort=<port>
https.proxyUser=<username>
https.proxyPassword=<password>