Skip to content

Commit c20a97f

Browse files
committed
Polish imports, README, etc.
1 parent 73a59f8 commit c20a97f

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

README.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,29 @@ Only, if you want to check manually, you can do a `docker-compose up -d` and ope
4444

4545
As client-bob only has access to the DNS aliases `server-alice` and `server-tom`, if it itself is part of the Docker (Compose) network and these aliases are used to access both client certificate secured endpoints, we need another way to run an Integration test inside the Docker network scope.
4646

47-
Therefore we use the [docker-compose-rule](https://github.com/palantir/docker-compose-rule) and the __docker-network-client__ that just calls client-bob inside the Docker network.
47+
Therefore we use the [docker-compose-rule](https://github.com/palantir/docker-compose-rule) and the __docker-network-client__ that just calls __client-bob__ inside the Docker network.
4848

49-
docker-compose-rule needs a special Maven repository to be added, because it is only served on Bintray.
49+
docker-compose-rule needs a special Maven repository to be added in `docker-network-client`, because it is only served on Bintray.
5050

51+
```
52+
<dependency>
53+
<groupId>com.palantir.docker.compose</groupId>
54+
<artifactId>docker-compose-rule-junit4</artifactId>
55+
<version>${docker-compose-rule-junit4.version}</version>
56+
<scope>test</scope>
57+
</dependency>
58+
59+
</dependencies>
60+
61+
<repositories>
62+
<repository>
63+
<id>bintray</id>
64+
<name>Bintray Maven Repository - as docker-compose-rule-junit4 is only available there</name>
65+
<url>https://dl.bintray.com/palantir/releases</url>
66+
<layout>default</layout>
67+
</repository>
68+
</repositories>
69+
```
5170

5271
# TlDR: How to create multiple keys & certificates for multiple servers - and add these into appropriate truststores / keystores
5372

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.jonashackt.client;
22

33
public interface ServerClient {
4-
public String callServerAlice();
4+
String callServerAlice();
55

6-
public String callServerTom();
6+
String callServerTom();
77
}

client-bob/src/main/java/de/jonashackt/configuration/RestClientCertConfiguration.java

-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package de.jonashackt.configuration;
22

33
import org.apache.commons.io.FileUtils;
4-
import org.apache.http.client.HttpClient;
5-
import org.apache.http.impl.client.HttpClients;
64
import org.apache.http.ssl.SSLContextBuilder;
75
import org.springframework.beans.factory.annotation.Value;
86
import org.springframework.context.annotation.Bean;
97
import org.springframework.context.annotation.Configuration;
108
import org.springframework.core.io.Resource;
11-
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
129

1310
import javax.net.ssl.SSLContext;
1411
import java.io.File;

client-bob/src/main/java/de/jonashackt/controller/BobController.java

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
@RestController
1010
public class BobController {
1111

12-
public static final String RESPONSE = "Hello Rest-User, here´s Alice!";
13-
1412
@Autowired
1513
private ServerClient serverClient;
1614

client-bob/src/test/java/de/jonashackt/BobTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class BobTest {
2525
@Autowired
2626
private RestTemplate restTemplate;
2727

28-
@Ignore("currently no localhost support, need to implement docker-compose rule for that")
28+
@Ignore("no localhost support, because without Docker we would need to bind the same Port 8443 of server-alice and server-tom two times, which isn´t possible")
2929
@Test
3030
public void is_hello_resource_callable_with_client_cert() {
3131
String response = restTemplate.getForObject("https://localhost:" + port + "/secretservers", String.class);

0 commit comments

Comments
 (0)