Skip to content

Conversation

@marcuslinke
Copy link
Contributor

@marcuslinke marcuslinke commented Jun 9, 2016

This change is Reviewable

// CHECKSTYLE:OFF
@Override
public boolean equals(Object o) {
if (this == o)
Copy link
Member

Choose a reason for hiding this comment

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

doesn't reflectionEquals checks all this things?

@KostyaSha
Copy link
Member

from first lookup LGTM

if (customSslContext == null) {
if (dockerTlsVerify) {
dockerCertPath = checkDockerCertPath(dockerCertPath);
sslContext = new LocalDirectorySSLConfig(dockerCertPath).getSSLContext();
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to store SSLConfig in DefaultClientConfig instead context?
I need know from what dockerCertPath connection was build.
Use case: calling default dockerclientconfig builder that gather configs, env vars, properties and they i extract dockercertPath for creating special remote test connection.

@KostyaSha
Copy link
Member

KostyaSha commented Jun 12, 2016

From second look i can't extract dockerCertPath from SSLContext, DefaultDockerClientConfig should store SSLConfig.

@KostyaSha
Copy link
Member

KostyaSha commented Jun 12, 2016

717d9f8

@KostyaSha
Copy link
Member

Pushed commit into this branch

@codecov-io
Copy link

codecov-io commented Jun 12, 2016

Current coverage is 30.54%

Merging #596 into master will increase coverage by 7.16%

  1. 2 files in ...thub/dockerjava/core were modified. more
    • Misses -4
    • Hits +4
  2. 2 files in ...om/github/dockerjava were modified. more
    • Misses -21
    • Hits +21
  3. 3 files (not in diff) in ...erjava/netty/handler were modified. more
    • Misses -19
    • Partials -2
    • Hits +21
  4. 17 files (not in diff) in ...ockerjava/netty/exec were modified. more
    • Misses -36
    • Hits +36
  5. 2 files (not in diff) in ...hub/dockerjava/netty were modified. more
    • Misses -11
    • Hits +11
  6. 5 files (not in diff) in ...kerjava/jaxrs/filter were modified. more
    • Misses -23
    • Hits +23
  7. 2 files (not in diff) in ...java/jaxrs/connector were modified. more
    • Misses -49
    • Hits +49
  8. 21 files (not in diff) in ...hub/dockerjava/jaxrs were modified. more
    • Misses -46
    • Hits +46
  9. 5 files (not in diff) in ...dockerjava/core/util were modified. more
    • Misses -24
    • Partials -6
    • Hits +30
  10. 2 files (not in diff) in ...java/core/dockerfile were modified. more
    • Misses -15
    • Partials -11
    • Hits +26
@@             master       #596   diff @@
==========================================
  Files           296        296          
  Lines          6262       6260     -2   
  Methods           0          0          
  Messages          0          0          
  Branches        561        560     -1   
==========================================
+ Hits           1464       1912   +448   
+ Misses         4704       4348   -356   
+ Partials         94          0    -94   

Powered by Codecov. Last updated by 3a2dcc4...0063563

@marcuslinke
Copy link
Contributor Author

What's the goal of your latest commit? Why you want DockerClientConfig expose SSLConfig?

@KostyaSha
Copy link
Member

KostyaSha commented Jun 12, 2016

What's the goal of your latest commit? Why you want DockerClientConfig expose SSLConfig?

Because i need know exact SSLConfig configuration that provided SSL connection. I can get hosts, names, etc, but not ssl part. That's why SSLConfig (like it was before) should be stored and not SSLContext.
Fix is not final, still testing it. Found NPE (lost if check).

PS Found that com.github.dockerjava.netty.DockerCmdExecFactoryImpl.InetSocketInitializer#init has
final SocketAddress proxyAddress = new InetSocketAddress(addr, 8008); that never used.

@KostyaSha
Copy link
Member

Seems now works fine. Tested from my fork https://github.com/KostyaSha/docker-java/commits/3.0.0-kostyasha

*/
public class DefaultDockerClientConfig implements Serializable, DockerClientConfig {

private static final long serialVersionUID = -4307357472441531489L;
Copy link
Member

Choose a reason for hiding this comment

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

1L if it new class

@KostyaSha
Copy link
Member

TODO update README.md after merge because builder will change?

@marcuslinke
Copy link
Contributor Author

@KostyaSha OK, understood now. Feel free to fix your comments and merge.

@KostyaSha
Copy link
Member

ok

"Enabled TLS verification (DOCKER_TLS_VERIFY=1) but certifate path (DOCKER_CERT_PATH) is not defined.");
} else {
File certPath = new File(dockerCertPath);
}
Copy link
Member

Choose a reason for hiding this comment

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

removed nested ifs, should be better readable now

@KostyaSha
Copy link
Member

@marcuslinke please review

@marcuslinke marcuslinke merged commit 9ae14cb into master Jun 13, 2016
@marcuslinke
Copy link
Contributor Author

@KostyaSha Thanks!

@KostyaSha
Copy link
Member

@marcuslinke thanks to you for better solution!

@KostyaSha
Copy link
Member

Would it be 3.0.1? I created 3.0.1 milestone.

@KostyaSha KostyaSha added this to the 3.0.1 milestone Jun 13, 2016
@marcuslinke marcuslinke deleted the refact-sslconfig branch June 13, 2016 21:03
@KostyaSha
Copy link
Member

Causes issues in integration tests. Will try fix later

panuse pushed a commit to TuKangTech/docker-java that referenced this pull request Aug 20, 2017
…ocker-java#596)

* Refactor configuration of SSL to allow override with custom config

* Store SSLConfig instead SSLContext

* avoid NPE

* prepare release

* Coding style changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants