mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
This makes sure that when SSL is enabled (for FS/single node mode), the server address is picked up from the --address option (that needs to include the hostname for SSL verification, and has to be input appropriately by user), instead of just using ":<port>".
This commit is contained in:
parent
95567c68bf
commit
6274727b71
@ -97,7 +97,7 @@ func splitNetPath(networkPath string) (netAddr, netPath string, err error) {
|
||||
// `host:port` format.
|
||||
func getLocalAddress(srvCmdConfig serverCmdConfig) string {
|
||||
if !srvCmdConfig.isDistXL {
|
||||
return fmt.Sprintf(":%d", globalMinioPort)
|
||||
return srvCmdConfig.serverAddr
|
||||
}
|
||||
for _, export := range srvCmdConfig.disks {
|
||||
// Validates if remote disk is local.
|
||||
|
@ -245,6 +245,7 @@ func TestLocalAddress(t *testing.T) {
|
||||
// Test 2 - local address is everything.
|
||||
{
|
||||
srvCmdConfig: serverCmdConfig{
|
||||
serverAddr: fmt.Sprintf(":%d", globalMinioPort),
|
||||
isDistXL: false,
|
||||
disks: []string{
|
||||
"/mnt/disk1",
|
||||
@ -268,6 +269,22 @@ func TestLocalAddress(t *testing.T) {
|
||||
},
|
||||
localAddr: "",
|
||||
},
|
||||
// Test 4 - in case of FS mode, with SSL, the host
|
||||
// name is specified in the --address option on the
|
||||
// server command line.
|
||||
{
|
||||
srvCmdConfig: serverCmdConfig{
|
||||
serverAddr: "play.minio.io:9000",
|
||||
isDistXL: false,
|
||||
disks: []string{
|
||||
"/mnt/disk1",
|
||||
"/mnt/disk2",
|
||||
"/mnt/disk3",
|
||||
"/mnt/disk4",
|
||||
},
|
||||
},
|
||||
localAddr: "play.minio.io:9000",
|
||||
},
|
||||
}
|
||||
|
||||
// Validates fetching local address.
|
||||
|
Loading…
Reference in New Issue
Block a user