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

Release #39

Merged
merged 6 commits into from
Feb 6, 2016
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public void Ok(string html)
var result = Encoding.Default.GetBytes(html);

var connectStreamWriter = new StreamWriter(this.Client.ClientStream);
connectStreamWriter.WriteLine(string.Format("{0} {2} {3}", ProxySession.Request.HttpVersion, 200, "Ok"));
connectStreamWriter.WriteLine(string.Format("{0} {1} {2}", ProxySession.Request.HttpVersion, 200, "Ok"));
connectStreamWriter.WriteLine("Timestamp: {0}", DateTime.Now);
connectStreamWriter.WriteLine("content-length: " + result.Length);
connectStreamWriter.WriteLine("Cache-Control: no-cache, no-store, must-revalidate");
Expand Down
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