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

Commit

Permalink
Merge pull request #33 from sizingservers/dev
Browse files Browse the repository at this point in the history
Locate makecert.exe next to the assembly
  • Loading branch information
justcoding121 committed Jan 16, 2016
2 parents a88c68c + 6b2d758 commit a92ac4c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Titanium.Web.Proxy/Helpers/CertificateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Reflection;

namespace Titanium.Web.Proxy.Helpers
{
Expand Down Expand Up @@ -112,14 +113,16 @@ protected virtual void CreateCertificate(string[] args)
{
using (var process = new Process())
{
if (!File.Exists("makecert.exe"))
string file = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "makecert.exe");

if (!File.Exists(file))
throw new Exception("Unable to locate 'makecert.exe'.");

process.StartInfo.Verb = "runas";
process.StartInfo.Arguments = args != null ? args[0] : string.Empty;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = "makecert.exe";
process.StartInfo.FileName = file;

process.Start();
process.WaitForExit();
Expand Down

0 comments on commit a92ac4c

Please sign in to comment.