I had been dealing with this issue and I’m using a self-hosted WCF service. I just made the breakthrough:
I had a certificate in the personnel folder for the Machine store. It expired and my manager issued a new one. The new one failed for me with this error. I tried a lot of stuff from Google but in the end, resolved the issue using a completely different solution.
I installed both certificates- the expired one and the newer one. Then I used this command to get a list of them:
certutil -store My
I get this output (info is fake and other certificate are not listed):
================ Certificate 1 ================
Serial Number: 6d
Issuer: E=operations@voicetrust.com, CN=VoiceTrust Server CA, OU=VoiceTrust Oper
ations, O=VoiceTrust
NotBefore: 03-Jan-2013 3:33 PM
NotAfter: 03-Mar-2013 3:33 PM
Subject: E=hgulzar@voicetrust.com, CN=hornet.voicetrust.com, OU=Software Develop
ment, O=VoiceTrust eServices MENA FZ LLC, L=Dubai, C=AE
Non-root Certificate
Cert Hash(sha1): 98 5f a0 d3 11 6a 4b 64 3b db 0a a4 11 66 fc 08 28 74 7e 53
Key Container = {E5BC0912-7808-4B89-B457-31946DE5990E}
Unique container name: dfedfcc149408fb990a3bacd6d31126b_3277b2c9-9894-46d0-9b6
4-30f0d6589239
Provider = Microsoft Enhanced Cryptographic Provider v1.0
Private key is NOT exportable
Encryption test passed
================ Certificate 2 ================
Serial Number: 6d
Issuer: E=operations@voicetrust.com, CN=VoiceTrust Server CA, OU=VoiceTrust Oper
ations, O=VoiceTrust
NotBefore: 03-Nov-2013 3:33 PM
NotAfter: 03-Dec-2013 3:33 PM
Subject: E=hgulzar@voicetrust.com, CN=hornet.voicetrust.com, OU=Software Develop
ment, O=VoiceTrust eServices MENA FZ LLC, L=Dubai, C=AE
Non-root Certificate
Cert Hash(sha1): 30 5f a0 d3 11 6a 4b 64 3b db 0a a4 11 66 fc 08 28 74 7e 53
Key Container = {E5BC0912-7808-4B89-B457-31946DE5960E}
*Unique container name:* 55edfcc149408fb990a3bacd6d31126b_3277b2c9-9894-46d0-9b6
4-30f0d6589239
Provider = Microsoft Enhanced Cryptographic Provider v1.0
Private key is NOT exportable
Encryption test passed
Now, everything seems OK but certificate 1 is expired and works if I try to bind it to a port whereas Certificate 2 fails with Error 1312.
The key difference that baffled me was the Unique container name property. It should be representing a physical key file on the hard drive in the %ProgramData%\Microsoft\Crypto\RSA\MachineKeys\
For Certificate 1, the file was there but for Certificate 2, there was no such file. After searching I found the file against Certificate 2 in the sub folder of %AppData%\Microsoft\Crypto\
folder. That’s user specific keys not Machine level keys. It’s amazing that the certificate is being imported into Computer store yet it always keeps the container key of User’s store.
I deleted the ’55edfcc149408fb990a3bacd6d31126b_3277b2c9-9894-46d0-9b64-30f0d6589239′ file under the AppData folder and ran the repair command for my certificate 2 on the store:
certutil -repairstore My 2
This time, the Unique container name was reflecting a file in the proper folder under ‘%ProgramData%\Microsoft\Crypto\’ and everything started working.
Hope this is helpful to someone.
Симптомы
При попытке запуска на компьютере под управлением Windows Server 2008 R2 или Windows 7 следующую команду netsh :
Netsh http добавить sslcert ipport = certhash< IP-адрес и порт для привязки SSL > =< хеш сертификата > appid = slctlstorename< GUID владельца приложения > =< имя, в котором хранится список доверия Сертификатов хранилища > sslctlidentifier =< значение CTL >Примечание. Эта команда добавляет список доверия сертификатов (CTL) к привязке безопасного sockets layer (SSL).
Тем не менее операция не выполняется и появляется сообщение об ошибке, подобное приведенному ниже:
Сбой добавления сертификата SSL: 1312
Указанный сеанс не существует. Возможно, он уже был завершен.
Причина
Эта проблема возникает, так как строки Юникода в параметрах структуры неправильно усекаются при передаче этих строк для удаленного вызова процедуры (RPC). Таким образом происходит сбой операции проверки подлинности.
Решение
Сведения об исправлении
Существует исправление от корпорации Майкрософт. Однако данное исправление предназначено для устранения только проблемы, описанной в этой статье. Применяйте это исправление только в тех случаях, когда наблюдается проблема, описанная в данной статье. Это исправление может проходить дополнительное тестирование. Таким образом если вы не подвержены серьезно этой проблеме, рекомендуется дождаться следующего пакета обновления, содержащего это исправление.
Если исправление доступно для скачивания, имеется раздел «Пакет исправлений доступен для скачивания» в верхней части этой статьи базы знаний. Если этот раздел не отображается, обратитесь в службу поддержки для получения исправления.
Примечание. Если наблюдаются другие проблемы или необходимо устранить неполадки, вам может понадобиться создать отдельный запрос на обслуживание. Стандартная оплата за поддержку будет взиматься только за дополнительные вопросы и проблемы, которые не соответствуют требованиям конкретного исправления. Чтобы получить полный список телефонов поддержки и обслуживания клиентов корпорации Майкрософт или создать отдельный запрос на обслуживание, посетите следующий веб-сайт корпорации Майкрософт:
http://support.microsoft.com/contactus/?ws=supportПримечание. В форме «Пакет исправлений доступен для скачивания» отображаются языки, для которых доступно исправление. Если нужный язык не отображается, значит исправление для данного языка отсутствует.
Предварительные условия
Не существует предварительных условий.
Сведения о реестре
Для использования исправления из этого пакета нет необходимости вносить изменения в реестр.
Необходимость перезагрузки
Может потребоваться перезагрузить компьютер после установки данного исправления.
Сведения о замене исправлений
Это исправление не заменяет ранее выпущенные исправления.
Сведения о файлах
Глобальная версия этого исправления устанавливает файлы с атрибутами, указанными в приведенных ниже таблицах. Дата и время для файлов указаны в формате UTC. Дата и время для файлов на локальном компьютере отображаются в местном времени с вашим текущим смещением летнего времени (DST). Кроме того, при выполнении определенных операций с файлами, даты и время могут изменяться.
Примечания к сведениям о файлах Windows 7 и Windows Server 2008 R2
Важно. Исправления для Windows Server 2008 R2 и Windows 7 включены в одни и те же пакеты. Однако исправления на странице запроса исправлений перечислены под обеими операционными системами. Чтобы запросить пакет исправления, который применяется к одной или обеим ОС, установите исправление, описанное в разделе «Windows 7/Windows Server 2008 R2» страницы. Всегда смотрите раздел «Информация в данной статье относится к следующим продуктам» статьи для определения фактических операционных систем, к которым применяется каждое исправление.
-
Файлы MANIFEST (.manifest) и MUM (.mum), устанавливаемые для каждой среды, указаны отдельно в разделе «Сведения о дополнительных файлах для Windows Server 2008 R2 и Windows 7». Файлы MUM и MANIFEST, а также связанные файлы каталога безопасности (CAT) чрезвычайно важны для поддержания состояния обновленных компонентов. Файлы каталога безопасности, для которых не перечислены атрибуты, подписаны цифровой подписью корпорации Майкрософт.
Для всех поддерживаемых 86-разрядных версий Windows 7
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
---|---|---|---|---|---|
Cng.sys |
6.1.7600.16385 |
369,568 |
14-Jul-2009 |
01:17 |
x86 |
Ksecdd.sys |
6.1.7600.20667 |
67,472 |
13-Mar-2010 |
07:16 |
x86 |
Ksecpkg.sys |
6.1.7600.20667 |
133,512 |
13-Mar-2010 |
07:16 |
x86 |
Lsasrv.dll |
6.1.7600.20667 |
1,037,312 |
13-Mar-2010 |
07:13 |
x86 |
Lsasrv.mof |
Неприменимо |
13,780 |
10-Jun-2009 |
21:33 |
Неприменимо |
Lsass.exe |
6.1.7600.16385 |
22,528 |
14-Jul-2009 |
01:14 |
x86 |
Secur32.dll |
6.1.7600.16385 |
22,016 |
14-Jul-2009 |
01:16 |
x86 |
Sspicli.dll |
6.1.7600.20667 |
100,352 |
13-Mar-2010 |
07:13 |
x86 |
Sspisrv.dll |
6.1.7600.20667 |
15,360 |
13-Mar-2010 |
07:13 |
x86 |
Для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
---|---|---|---|---|---|
Cng.sys |
6.1.7600.16385 |
460,504 |
14-Jul-2009 |
01:43 |
x64 |
Ksecdd.sys |
6.1.7600.20667 |
95,624 |
13-Mar-2010 |
08:00 |
x64 |
Ksecpkg.sys |
6.1.7600.20667 |
152,968 |
13-Mar-2010 |
08:00 |
x64 |
Lsasrv.dll |
6.1.7600.20667 |
1,446,912 |
13-Mar-2010 |
07:57 |
x64 |
Lsasrv.mof |
Неприменимо |
13,780 |
10-Jun-2009 |
20:52 |
Неприменимо |
Lsass.exe |
6.1.7600.16385 |
31,232 |
14-Jul-2009 |
01:39 |
x64 |
Secur32.dll |
6.1.7600.16385 |
28,160 |
14-Jul-2009 |
01:41 |
x64 |
Sspicli.dll |
6.1.7600.20667 |
136 192 |
13-Mar-2010 |
07:57 |
x64 |
Sspisrv.dll |
6.1.7600.20667 |
28,672 |
13-Mar-2010 |
07:57 |
x64 |
Lsasrv.mof |
Неприменимо |
13,780 |
22-Jul-2009 |
23:19 |
Неприменимо |
Secur32.dll |
6.1.7600.20667 |
22,016 |
13-Mar-2010 |
07:13 |
x86 |
Sspicli.dll |
6.1.7600.20667 |
96,768 |
13-Mar-2010 |
07:11 |
x86 |
Для всех поддерживаемых версий Windows Server 2008 R2 для систем на базе процессоров IA-64
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
---|---|---|---|---|---|
Cng.sys |
6.1.7600.16385 |
787,736 |
14-Jul-2009 |
01:52 |
IA-64 |
Ksecdd.sys |
6.1.7600.20667 |
179,600 |
13-Mar-2010 |
06:42 |
IA-64 |
Ksecpkg.sys |
6.1.7600.20667 |
307,088 |
13-Mar-2010 |
06:42 |
IA-64 |
Lsasrv.dll |
6.1.7600.20667 |
2,654,720 |
13-Mar-2010 |
06:34 |
IA-64 |
Lsasrv.mof |
Неприменимо |
13,780 |
10-Jun-2009 |
20:57 |
Неприменимо |
Lsass.exe |
6.1.7600.16385 |
56,320 |
14-Jul-2009 |
01:44 |
IA-64 |
Secur32.dll |
6.1.7600.16385 |
48,640 |
14-Jul-2009 |
01:48 |
IA-64 |
Sspicli.dll |
6.1.7600.20667 |
275,456 |
13-Mar-2010 |
06:38 |
IA-64 |
Sspisrv.dll |
6.1.7600.20667 |
45,568 |
13-Mar-2010 |
06:38 |
IA-64 |
Lsasrv.mof |
Неприменимо |
13,780 |
22-Jul-2009 |
23:19 |
Неприменимо |
Secur32.dll |
6.1.7600.20667 |
22,016 |
13-Mar-2010 |
07:13 |
x86 |
Sspicli.dll |
6.1.7600.20667 |
96,768 |
13-Mar-2010 |
07:11 |
x86 |
Статус
Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».
Дополнительные сведения
Дополнительные сведения о настройке порта с помощью SSL-сертификат, посетите следующий веб-узел корпорации Майкрософт:
Описание 824684 Стандартные термины, используемые при описании обновлений программных продуктов Майкрософт
Сведения о дополнительных файлах
Сведения о дополнительных файлах для Windows 7 и Windows Server 2008 R2
Дополнительные файлы для всех поддерживаемых 86-разрядных версий Windows 7
Имя файла |
Update.mum |
Версия файла |
Неприменимо |
Размер файла |
1,674 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
X86_1421ac8a9f6ef3ce8b937b0ae56209ae_31bf3856ad364e35_6.1.7600.20667_none_23708961b103e635.manifest |
Версия файла |
Неприменимо |
Размер файла |
691 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
X86_microsoft-windows-lsa_31bf3856ad364e35_6.1.7600.20667_none_a6c221e8d72a628b.manifest |
Версия файла |
Неприменимо |
Размер файла |
103,660 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
11:02 |
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2
Имя файла |
Amd64_c1f3ccb091321f5245e74fc410074621_31bf3856ad364e35_6.1.7600.20667_none_649488b89ab1f4e7.manifest |
Версия файла |
Неприменимо |
Размер файла |
1,032 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
Amd64_efb13a188cefafdfd852e77573ce5875_31bf3856ad364e35_6.1.7600.20667_none_664f738e7e9b11f8.manifest |
Версия файла |
Неприменимо |
Размер файла |
695 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
Amd64_microsoft-windows-lsa_31bf3856ad364e35_6.1.7600.20667_none_02e0bd6c8f87d3c1.manifest |
Версия файла |
Неприменимо |
Размер файла |
103,664 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
11:05 |
Платформа |
Неприменимо |
Имя файла |
Update.mum |
Версия файла |
Неприменимо |
Размер файла |
1,906 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
Wow64_microsoft-windows-lsa_31bf3856ad364e35_6.1.7600.20667_none_0d3567bec3e895bc.manifest |
Версия файла |
Неприменимо |
Размер файла |
86,382 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
07:37 |
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых версий Windows Server 2008 R2 с архитектурой IA-64
Имя файла |
Ia64_aba017386f21d586120feaa3c20f5705_31bf3856ad364e35_6.1.7600.20667_none_3341405f4af61718.manifest |
Версия файла |
Неприменимо |
Размер файла |
1,030 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
Ia64_microsoft-windows-lsa_31bf3856ad364e35_6.1.7600.20667_none_a6c3c5ded7286b87.manifest |
Версия файла |
Неприменимо |
Размер файла |
103,662 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
Update.mum |
Версия файла |
Неприменимо |
Размер файла |
1,684 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
10:55 |
Платформа |
Неприменимо |
Имя файла |
Wow64_microsoft-windows-lsa_31bf3856ad364e35_6.1.7600.20667_none_0d3567bec3e895bc.manifest |
Версия файла |
Неприменимо |
Размер файла |
86,382 |
Дата (UTC) |
13-Mar-2010 |
Время (UTC) |
07:37 |
Платформа |
Неприменимо |
I’m building a C# console app that’ll:
[1.] Generate a self-signed certificate.
[2.] Add it to the Personal (Local Computer Store)
[3.] And finally assign that certificate to a port number on the machine with the netsh command.
So far, I got parts [1.] and [2.] working perfectly, but on [3.] I’m plagued with the useless and non-informal error message:
SSL Certificate add failed, Error: 1312 A specified logon session does
not exist. It may already have been terminated.
When I go look at Microsoft’s official page about this issue:
https://support.microsoft.com/en-us/kb/981506
It’s basically telling me that this is a Windows Operating System bug and that I should request a hotfix.
My Hack Solution To This Problem:
One way I was able to finally bypass this error, was by Opening IIS Home>Open «Server Certificates» Feature> And then Importing my .pfx certificate.
By importing the .pfx to IIS, I seemed to be able to get around the issue without trouble. I only needed to generate a .pfx by running both these two commands in order
1.) C:\OpenSSL-Win32\bin>openssl req -x509 -sha256 -nodes -days 365 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -newkey rsa:2048 -keyout privateKey.key -out certificate.crt
2.) C:\OpenSSL-Win32\bin>openssl pkcs12 -export -out cert.pfx -inkey privateKey.key -in certificate.crt -passout pass:
So if I run those two commands to openssl right now, and import them via IIS to my Personal Local Computer certificate store, I’ll have no SSL Certificate add failed, Error: 1312
problem.
But if I add the newly generated certificate programatically to my Personal Local Computer certificate store, then I do get the Error:1312 problem.
Here’s my code:
using CERTENROLLLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Text;
using System.Security.Cryptography;
using System.Diagnostics;
namespace Generate_X509_Certificate
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Guid.NewGuid().ToString());
Console.ReadLine();
// Launch OpenSSL:
string cPath = @"C:\OpenSSL-Win32\bin\";
string filename = Path.Combine(cPath, @"openssl.exe");
// Generate a .crt file
Console.WriteLine(@"Generating SSL Certificate...");
ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\OpenSSL-Win32\bin\openssl.exe", @"req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt -subj ""/C=US/ST=California/L=SanFrancisco/CN=SecurityEncryption""");
Process.Start(startInfo);
// Combine the .crt with the .key to form a more Windows friendly .pfx
Console.WriteLine(@"Combining Private Key With Certificate...");
Process proc2 = Process.Start(filename, "pkcs12 -export -out cert.pfx -inkey privateKey.key -in certificate.crt -passout pass:");
proc2.Close();
// Store our newly created .pfx file as a variable
X509Certificate2 cert = new X509Certificate2(Directory.GetCurrentDirectory()+@"\cert.pfx");
// Add our .pfx file into the Personal Local Computer store:
var store = new X509Store(StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadWrite);
store.Add(cert);
store.Close();
// Finally, use netsh to assign this newly generated certificate to port 6613
string s1 = "netsh http add sslcert ipport=0.0.0.0:6613 certhash=" + cert.GetCertHashString() + " appid={" + Guid.NewGuid().ToString() + "}";
Process p1 = new Process();
p1.StartInfo.FileName = "netsh.exe";
p1.StartInfo.Arguments = s1;
p1.StartInfo.UseShellExecute = false;
p1.StartInfo.RedirectStandardOutput = true;
// 👎 this is where I get the error "SSL Certificate add failed, Error: 1312"
p1.Start();
}
}
}
Here’s the netsh command that works perfectly fine as long as I’m not executing it in this C# program:
netsh http add sslcert ipport=0.0.0.0:6613
certhash=8834efd403687b331363ce9e5657ba4ffba0075b
appid={e604f84f-e666-4ccf-af52-fdeca666b5e9}
The Confusing Part
So if you were to execute my openssl
commands verbatim from this thread, than import the .pfx
file generated by openssl into IIS and finally use the netssh
command as seen above with the proper certificate hash, than this entire thing works perfectly. But when you do what I just said automatically in the C# code above, I get the Error.
Another thing, the .pfx generated than imported into the store from this code will not work at all when you try to manually netsh
it through the command line.
Does anyone have any ideas?
I had been dealing with this issue and I’m using a self-hosted WCF service. I just made the breakthrough:
I had a certificate in the personnel folder for the Machine store. It expired and my manager issued a new one. The new one failed for me with this error. I tried a lot of stuff from Google but in the end, resolved the issue using a completely different solution.
I installed both certificates- the expired one and the newer one. Then I used this command to get a list of them:
certutil -store My
I get this output (info is fake and other certificate are not listed):
================ Certificate 1 ================
Serial Number: 6d
Issuer: E=operations@voicetrust.com, CN=VoiceTrust Server CA, OU=VoiceTrust Oper
ations, O=VoiceTrust
NotBefore: 03-Jan-2013 3:33 PM
NotAfter: 03-Mar-2013 3:33 PM
Subject: E=hgulzar@voicetrust.com, CN=hornet.voicetrust.com, OU=Software Develop
ment, O=VoiceTrust eServices MENA FZ LLC, L=Dubai, C=AE
Non-root Certificate
Cert Hash(sha1): 98 5f a0 d3 11 6a 4b 64 3b db 0a a4 11 66 fc 08 28 74 7e 53
Key Container = {E5BC0912-7808-4B89-B457-31946DE5990E}
Unique container name: dfedfcc149408fb990a3bacd6d31126b_3277b2c9-9894-46d0-9b6
4-30f0d6589239
Provider = Microsoft Enhanced Cryptographic Provider v1.0
Private key is NOT exportable
Encryption test passed
================ Certificate 2 ================
Serial Number: 6d
Issuer: E=operations@voicetrust.com, CN=VoiceTrust Server CA, OU=VoiceTrust Oper
ations, O=VoiceTrust
NotBefore: 03-Nov-2013 3:33 PM
NotAfter: 03-Dec-2013 3:33 PM
Subject: E=hgulzar@voicetrust.com, CN=hornet.voicetrust.com, OU=Software Develop
ment, O=VoiceTrust eServices MENA FZ LLC, L=Dubai, C=AE
Non-root Certificate
Cert Hash(sha1): 30 5f a0 d3 11 6a 4b 64 3b db 0a a4 11 66 fc 08 28 74 7e 53
Key Container = {E5BC0912-7808-4B89-B457-31946DE5960E}
*Unique container name:* 55edfcc149408fb990a3bacd6d31126b_3277b2c9-9894-46d0-9b6
4-30f0d6589239
Provider = Microsoft Enhanced Cryptographic Provider v1.0
Private key is NOT exportable
Encryption test passed
Now, everything seems OK but certificate 1 is expired and works if I try to bind it to a port whereas Certificate 2 fails with Error 1312.
The key difference that baffled me was the Unique container name property. It should be representing a physical key file on the hard drive in the %ProgramData%\Microsoft\Crypto\RSA\MachineKeys\
For Certificate 1, the file was there but for Certificate 2, there was no such file. After searching I found the file against Certificate 2 in the sub folder of %AppData%\Microsoft\Crypto\
folder. That’s user specific keys not Machine level keys. It’s amazing that the certificate is being imported into Computer store yet it always keeps the container key of User’s store.
I deleted the ’55edfcc149408fb990a3bacd6d31126b_3277b2c9-9894-46d0-9b64-30f0d6589239′ file under the AppData folder and ran the repair command for my certificate 2 on the store:
certutil -repairstore My 2
This time, the Unique container name was reflecting a file in the proper folder under ‘%ProgramData%\Microsoft\Crypto\’ and everything started working.
Hope this is helpful to someone.
- Remove From My Forums
-
Question
-
I am trying to get a self signed SSL cert bound to port 8080 for WCF unit testing on my Windows 2008 R2 development box.
I reserved the url without error:
netsh http add urlacl url=https://+:8080/ user=EVERYONE
Unfortunately, when I try to add the SSL binding for my certificate I get a wacky error.
«netsh http add sslcert ipport=0.0.0.0:8080 certhash=BE3102FAF81366C47B4E284D07E163128676DE77 appid={283647f3-ef12-4f46-8aeb-d59fc072dcda}»
«SSL Certificate add failed, Error: 1312
A specified logon session does not exist. It may already have been terminated.»
Note, previously I had bound a diff cert and decided to unbind it and go with a new self signed cert. The first cert seemed to bind without error.
Cert1 generated from these instructions:
http://blogs.msdn.com/b/james_osbornes_blog/archive/2010/12/10/selfhosting-a-wcf-service-over-https.aspx
Cert2 generated from these instructions:
http://msdn.microsoft.com/en-us/library/ff648498.aspx
Anyone else ever run into this?
Answers
-
For any poor soul that still encounters this issue, the 1312 error may be referring to the certificate store user. Your certificate has to come from the local MACHINE certificate store, not the current user certificate store (if using certmgr, do mmc->add/remove
snapin ->computer account (NOT the default that comes up when you run certmgr.msc!!!). Then get the cert from the personal area of the computer account). Of course, the certificate you select should be valid too.Yes this thread is old, but the issue still exists, and you should try this before deleting things or generating a bunch of certificates.
-
Marked as answer by
Tuesday, November 13, 2012 4:22 PM
-
Marked as answer by
-
No, but it worked for Cert1. I finally deleted all the netsh config, regenerated a new cert, and did the steps for #2. Worked fine this time around.
thanks
-
Marked as answer by
scott_m
Saturday, March 12, 2011 3:50 AM
-
Marked as answer by