File tree 2 files changed +18
-1
lines changed
main/java/io/r2dbc/postgresql/client
test/java/io/r2dbc/postgresql/client
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public static boolean isValidSniHostname(String input) {
108
108
return false ;
109
109
}
110
110
}
111
- return true ;
111
+ return ! input . endsWith ( "." ) ;
112
112
}
113
113
114
114
//
Original file line number Diff line number Diff line change
1
+ package io .r2dbc .postgresql .client ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+
5
+ import static org .assertj .core .api .Assertions .assertThat ;
6
+
7
+ /**
8
+ * Unit tests for {@link SSLConfig}.
9
+ */
10
+ final class SSLConfigTests {
11
+ @ Test
12
+ public void testValidSniHostname (){
13
+ assertThat (SSLConfig .isValidSniHostname ("example.com" )).isEqualTo (true );
14
+ assertThat (SSLConfig .isValidSniHostname ("example://.com" )).isEqualTo (false );
15
+ assertThat (SSLConfig .isValidSniHostname ("example.com." )).isEqualTo (false );
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments