-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #258 from rabbitmq/fix/uri_string
Fix string function of URI
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,24 @@ func startTLSServer(t *testing.T, cfg *tls.Config) tlsServer { | |
return s | ||
} | ||
|
||
func TestTlsConfigFromUriPushdownServerNameIndication(t *testing.T) { | ||
uri := "amqps://user:[email protected]:5671?server_name_indication=another-hostname.com" | ||
parsedUri, err := ParseURI(uri) | ||
if err != nil { | ||
t.Fatalf("expected to parse URI successfully, got error: %s", err) | ||
} | ||
|
||
tlsConf, err := tlsConfigFromURI(parsedUri) | ||
if err != nil { | ||
t.Fatalf("expected tlsConfigFromURI to succeed, got error: %s", err) | ||
} | ||
|
||
const expectedServerName = "another-hostname.com" | ||
if tlsConf.ServerName != expectedServerName { | ||
t.Fatalf("expected tlsConf server name to equal Uri servername: want %s, got %s", expectedServerName, tlsConf.ServerName) | ||
} | ||
} | ||
|
||
// Tests opening a connection of a TLS enabled socket server | ||
func TestTLSHandshake(t *testing.T) { | ||
srv := startTLSServer(t, tlsServerConfig(t)) | ||
|
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
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