Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy support with basic authentication has been added using system properties #314

Closed
wants to merge 1 commit into from

Conversation

jacombo
Copy link

@jacombo jacombo commented May 31, 2018

Dokka is great plugin unfortunatelly can't be used in corporates behind proxy therefore proxy support with basic authentication has been added using system properties below

-Dhttp.proxyHost=host.domain.com
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=host.domain.com
-Dhttps.proxyPort=8080
-DproxySet=true
-DproxyUser=user
-DproxyPassword=password

if proxySet is true and proxyUser with proxyPassword is set then basic proxy authentication is added

…roperties below

-Dhttp.proxyHost=host.domain.com
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=host.domain.com
-Dhttps.proxyPort=8080
-DproxySet=true
-DproxyUser=user
-DproxyPassword=password
@@ -46,6 +46,16 @@ class ExternalDocumentationLinkResolver @Inject constructor(
connection.connectTimeout = timeout
connection.readTimeout = timeout

// Add proxy basic authentication when proxyUser, proxyPassword is set and proxySet is true
val systemSettings = System.getProperties()
if (systemSettings.getValue("proxySet").toString() == "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far, as I debugged, Gradle already support basic authentification, so no need for such code in Gradle runner plugin.
Isn't it better to use java.net.Authenticator? It looks like more straightforward approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why not to use http.proxyUser and so on?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you debug and verify also Maven + proxy + basic authentication ?

I will try also will try use "systemProp.jdk.http.auth.tunneling.disabledSchemes" too and let you know

we are no using Graddle at the moment so we need to fix Maven first

@semoro
Copy link
Contributor

semoro commented Jun 1, 2018

Dokka already supports proxy authentication according to my comment in #213 (comment)

@semoro
Copy link
Contributor

semoro commented Jun 1, 2018

Checked, doesn't work properly, looks like Dokka for Maven should use Maven transport API http://maven.apache.org/wagon/

@semoro
Copy link
Contributor

semoro commented Jun 1, 2018

So, anyway, changes is required

Copy link

@c16a c16a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't yet work when Gradle is run behind a corporate proxy. This change might fix it.

@kamildoleglo
Copy link
Contributor

Dokka has been rewritten since the creation of this PR, please open a new PR if the issue still persists ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants