Skip to content

fix: Allow empty paths in SecretsLoaderHelper #2250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public string ServerCommonName

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

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

[Tooltip("Server Certificate filepath")]
[SerializeField]
private string m_ServerCertificateFilePath = "Assets/Secure/myGameServerCertificate.pem";
private string m_ServerCertificateFilePath = ""; // "Assets/Secure/myGameServerCertificate.pem"

/// <summary>Server Certificate filepath</summary>
public string ServerCertificateFilePath
Expand All @@ -129,7 +129,7 @@ public string ServerCertificateFilePath

[Tooltip("Server Private Key filepath")]
[SerializeField]
private string m_ServerPrivateFilePath = "Assets/Secure/myGameServerPrivate.pem";
private string m_ServerPrivateFilePath = ""; // "Assets/Secure/myGameServerPrivate.pem"

/// <summary>Server Private Key filepath</summary>
public string ServerPrivateFilePath
Expand Down Expand Up @@ -174,6 +174,11 @@ public string ServerPrivate

private static string ReadFile(string path, string label)
{
if (path == null || path == "")
{
return "";
}

var reader = new StreamReader(path);
string fileContent = reader.ReadToEnd();
Debug.Log((fileContent.Length > 1) ? ("Successfully loaded " + fileContent.Length + " byte(s) from " + label) : ("Could not read " + label + " file"));
Expand Down