Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit a92ac4c

Browse files
committed
Merge pull request #33 from sizingservers/dev
Locate makecert.exe next to the assembly
2 parents a88c68c + 6b2d758 commit a92ac4c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Titanium.Web.Proxy/Helpers/CertificateManager.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Diagnostics;
44
using System.Collections.Generic;
55
using System.Security.Cryptography.X509Certificates;
6+
using System.Reflection;
67

78
namespace Titanium.Web.Proxy.Helpers
89
{
@@ -112,14 +113,16 @@ protected virtual void CreateCertificate(string[] args)
112113
{
113114
using (var process = new Process())
114115
{
115-
if (!File.Exists("makecert.exe"))
116+
string file = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "makecert.exe");
117+
118+
if (!File.Exists(file))
116119
throw new Exception("Unable to locate 'makecert.exe'.");
117120

118121
process.StartInfo.Verb = "runas";
119122
process.StartInfo.Arguments = args != null ? args[0] : string.Empty;
120123
process.StartInfo.CreateNoWindow = true;
121124
process.StartInfo.UseShellExecute = false;
122-
process.StartInfo.FileName = "makecert.exe";
125+
process.StartInfo.FileName = file;
123126

124127
process.Start();
125128
process.WaitForExit();

0 commit comments

Comments
 (0)