-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend SNIHostName check to reject hostnames with trailing dot.
[resolves #656]
- Loading branch information
1 parent
52a54b9
commit f08ac1c
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/java/io/r2dbc/postgresql/client/SSLConfigTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.r2dbc.postgresql.client; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* Unit tests for {@link SSLConfig}. | ||
*/ | ||
final class SSLConfigTests { | ||
@Test | ||
public void testValidSniHostname(){ | ||
assertThat(SSLConfig.isValidSniHostname("example.com")).isEqualTo(true); | ||
assertThat(SSLConfig.isValidSniHostname("example://.com")).isEqualTo(false); | ||
assertThat(SSLConfig.isValidSniHostname("example.com.")).isEqualTo(false); | ||
} | ||
} |