How to use proxy in applet manager?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
lightdarkx
Level 1
Level 1
Posts: 9
Joined: Thu Jan 18, 2018 7:54 am

How to use proxy in applet manager?

Post by lightdarkx »

As the subject says I want to use proxy in the applet manager in mint 18.3 cinnamon(3.6.7) as whenever I try to update the cache of applet manager it says "An error occurred while trying to access the server. Please try again in a little while. Details: HTTP error: Proxy Authentication Required ". I am under a http proxy which requires user-name and password. I have already set my proxy in the network section as well as in apt.conf file. Both apt and my web browser(firefox) are working fine. Is their a way to solve the problem?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
littlehuman
Level 1
Level 1
Posts: 48
Joined: Sun Jan 07, 2018 7:41 pm

Re: How to use proxy in applet manager?

Post by littlehuman »

Have you tried to add a user:password in front of the proxy server address in related config files, for instance http://user:password@proxy.domain.com:8080/

I would not recommended this as having password in clear text in config files is not a good thing, but that might be a workaround until someone more competent than me gives you a better way to fix this.

Also, not sure if this is all up-to-date, but it might also help you : http://www.ictsteps.com/2013/10/how-to- ... -mint.html
Vs lbh nfxrq Oehpr Fpuarvre gb qrpelcg guvf, ur'q pehfu lbhe fxhyy jvgu uvf ynhtu.
lightdarkx
Level 1
Level 1
Posts: 9
Joined: Thu Jan 18, 2018 7:54 am

Re: How to use proxy in applet manager?

Post by lightdarkx »

littlehuman wrote:Have you tried to add a user:password in front of the proxy server address in related config files, for instance http://user:password@proxy.domain.com:8080/

I would not recommended this as having password in clear text in config files is not a good thing, but that might be a workaround until someone more competent than me gives you a better way to fix this.

Also, not sure if this is all up-to-date, but it might also help you : http://www.ictsteps.com/2013/10/how-to- ... -mint.html
The problem is that I don't know the "related conf file" which the applet manager uses. I have changed the http_proxy and HTTP_PROXY variables but it still shows the 407 error.

PS-The steps mentioned in the website, I already use them for configuring apt with proxy. Plus from what I know, setting the proxy via GUI sets the proxy in the env( without the user-name and password). But then also I explicitly set the env via the export command.( Then also it didn't work)
littlehuman
Level 1
Level 1
Posts: 48
Joined: Sun Jan 07, 2018 7:41 pm

Re: How to use proxy in applet manager?

Post by littlehuman »

I don't know if this one's still valid and how to concretely test/apply this, but it seems it helped someone having a similar issue in the past https://github.com/linuxmint/Cinnamon/issues/2172
Vs lbh nfxrq Oehpr Fpuarvre gb qrpelcg guvf, ur'q pehfu lbhe fxhyy jvgu uvf ynhtu.
lightdarkx
Level 1
Level 1
Posts: 9
Joined: Thu Jan 18, 2018 7:54 am

Re: How to use proxy in applet manager?

Post by lightdarkx »

I didn't get what the person in the link did. It just redirected to cinnamon proxy page in github which is 5-6 years old. Can you explain what he did?
littlehuman
Level 1
Level 1
Posts: 48
Joined: Sun Jan 07, 2018 7:41 pm

Re: How to use proxy in applet manager?

Post by littlehuman »

Unfortunately, this is beyond my skills. What I would try if I was in your situation and nothing else works (be sure to backup your system, create a snapshot before you dothis change, understand that it can have unexpected side effects, as I'm here in total "sorcerer's apprentice zone") :

Given this https://stackoverflow.com/questions/340 ... tion#34116

And the fact that in https://github.com/linuxmint/Cinnamon/issues/2172 , they discuss about urllib2, I would try this :

in /usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py on your system, at end of the file, I would modify the following existing part of code

Code: Select all

    ps = proxygsettings.get_proxy_settings()
    if ps:
        proxy = urllib2.ProxyHandler(ps)
    else:
        proxy = urllib2.ProxyHandler()
    urllib2.install_opener(urllib2.build_opener(proxy))
to this

Code: Select all

    ps = proxygsettings.get_proxy_settings()
    if ps:
        proxy = urllib2.ProxyHandler(ps)
    else:
        proxy = urllib2.ProxyHandler()
    auth = urllib2.HTTPBasicAuthHandler()
    urllib2.install_opener(urllib2.build_opener(proxy,auth))
urllib2.HTTPHandler is added by default, so not added in the last line.
If it doesn't work, I would continue to "play" with this part of the code regarding https://stackoverflow.com/questions/340 ... tion#34116 sample, even testing with hardcoded values for the proxy settings, just to try and see..

I guess this settings file is loaded at opening session or at boot, I do not even know..

It might be totally wrong, but this is what I would try. Lab...

Also, be sure not to have a @ or a : neither in username nor in password

Again, do this at your own risk as it might cause bad side effects. That's what lab is :wink:
Vs lbh nfxrq Oehpr Fpuarvre gb qrpelcg guvf, ur'q pehfu lbhe fxhyy jvgu uvf ynhtu.
DrNoid

Re: How to use proxy in applet manager?

Post by DrNoid »

I know very little Python, but it seems to be that in

Code: Select all

/usr/share/cinnamon/cinnamon-settings/bin/Spices.py
the method

Code: Select all

_url_retrieve
just ignores any proxy settings.
Locked

Return to “Beginner Questions”