Skip to content

Commit adc06f6

Browse files
fix: Allow empty paths in SecretsLoaderHelper (#2250)
Co-authored-by: ashwini <[email protected]>
1 parent 1a17102 commit adc06f6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

com.unity.netcode.gameobjects/Runtime/Transports/UTP/SecretsLoaderHelper.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public string ServerCommonName
9393

9494
[Tooltip("Client CA filepath. Useful with self-signed certificates")]
9595
[SerializeField]
96-
private string m_ClientCAFilePath = "Assets/Secure/myGameClientCA.pem";
96+
private string m_ClientCAFilePath = ""; // "Assets/Secure/myGameClientCA.pem"
9797

9898
/// <summary>Client CA filepath. Useful with self-signed certificates</summary>
9999
public string ClientCAFilePath
@@ -118,7 +118,7 @@ public string ClientCAOverride
118118

119119
[Tooltip("Server Certificate filepath")]
120120
[SerializeField]
121-
private string m_ServerCertificateFilePath = "Assets/Secure/myGameServerCertificate.pem";
121+
private string m_ServerCertificateFilePath = ""; // "Assets/Secure/myGameServerCertificate.pem"
122122

123123
/// <summary>Server Certificate filepath</summary>
124124
public string ServerCertificateFilePath
@@ -129,7 +129,7 @@ public string ServerCertificateFilePath
129129

130130
[Tooltip("Server Private Key filepath")]
131131
[SerializeField]
132-
private string m_ServerPrivateFilePath = "Assets/Secure/myGameServerPrivate.pem";
132+
private string m_ServerPrivateFilePath = ""; // "Assets/Secure/myGameServerPrivate.pem"
133133

134134
/// <summary>Server Private Key filepath</summary>
135135
public string ServerPrivateFilePath
@@ -174,6 +174,11 @@ public string ServerPrivate
174174

175175
private static string ReadFile(string path, string label)
176176
{
177+
if (path == null || path == "")
178+
{
179+
return "";
180+
}
181+
177182
var reader = new StreamReader(path);
178183
string fileContent = reader.ReadToEnd();
179184
Debug.Log((fileContent.Length > 1) ? ("Successfully loaded " + fileContent.Length + " byte(s) from " + label) : ("Could not read " + label + " file"));

0 commit comments

Comments
 (0)