private void UpdateConnection(ConnectionParams connection, CredentialParams credential) { if (string.IsNullOrEmpty(connection.Uri)) { var uri = connection.Protocol + "://" + connection.Host; if (connection.Port != 0) { uri += ":" + connection.Port; } connection.Uri = uri; } else { var uri = new Uri(connection.Uri); connection.Protocol = uri.Scheme; connection.Host = uri.Host; connection.Port = uri.Port; } if (connection.Protocol == "https") { connection.AddSection("credential", credential.GetAsNullableString("internal_network") == null ? credential : new CredentialParams()); } else { connection.AddSection("credential", new CredentialParams()); } }