SSL certificates in Windows Server 2019 are typically stored in the Certificate Store, which is a database on the local machine that holds all the SSL certificates. Here are the steps to locate the SSL certificates in Windows Server 2019:
1. Open the «Run» dialogue box by pressing the «Windows Key + R» and type «mmc» to open the Microsoft Management Console.
2. In the Microsoft Management Console, go to «File» and select «Add/Remove Snap-in.«
3. In the «Add or Remove Snap-ins» window, select «Certificates» and click on the «Add» button.
4. In the «Certificates snap-in» window, select «Computer account» and click on the «Next» button.
5. In the «Select Computer» window, choose the «Local computer: (the computer this console is running on)» option and click on the «Finish» button.
6. Back in the «Add or Remove Snap-ins» window, click on the «OK» button.
7. You will now see the «Certificates» category in the console tree. Expand the tree by clicking on the arrow icon next to it.
8. To access SSL certificates, expand the following folders in order:
– Personal
– Certificates
9. Under the «Certificates» folder, you will find all the SSL certificates installed on your Windows Server 2019.
Please note that the location of SSL certificates may vary depending on the type of usage and configuration. It is recommended to consult your system administrator or follow the specific instructions provided by the Certificate Authority (CA) or the service where the SSL certificate was acquired from.
Video Tutorial:How do I get an SSL certificate from Windows Server?
How do I view installed certificates in Windows Server?
Viewing installed certificates in Windows Server is essential for managing security and troubleshooting issues. Here is a step-by-step guide to help you accomplish this:
1. Launch the Microsoft Management Console (MMC):
– Press the Windows key + R to open the Run dialog box.
– Type «mmc» and hit Enter. The MMC window will open.
2. Add the Certificates Snap-in:
– In the MMC window, navigate to File > Add/Remove Snap-in or click on the «File» menu and select «Add/Remove Snap-in«.
– In the Add or Remove Snap-ins dialog box, select «Certificates» from the Available snap-ins list and click on the «Add» button.
– Choose the «Computer account» option and click «Next«.
– Select the «Local computer» option and click on «Finish«.
– Click «OK» to close the Add or Remove Snap-ins dialog box.
3. View the Installed Certificates:
– In the MMC window, expand «Certificates (Local Computer)» > «Personal» > «Certificates«.
– Here, you’ll find a list of installed certificates on your Windows Server.
– You can sort the list by different columns, such as «Issued To» or «Expiration Date«, to find specific certificates.
– Double-click on a certificate to view its details, including the issuer, subject, and validity period.
– Use the tabs at the top of the certificate properties window to access additional information, such as the certification path and extensions.
By following these steps, you can easily view the installed certificates on your Windows Server using the Microsoft Management Console. This functionality allows you to monitor and manage the security of your server environment effectively.
How do I remove old SSL certificate from Windows server?
To remove an old SSL certificate from a Windows server, follow these steps:
Step 1: Open the Microsoft Management Console (MMC)
– Press the Windows key + R to open the Run dialog box
– Type «mmc» and press Enter
Step 2: Add the Certificates Snap-in
– In the MMC, go to File -> Add/Remove Snap-in
– Select «Certificates» and click on the «Add» button
– Choose «Computer account» and click «Next«
– Select «Local computer» and click «Finish«
– Click «OK» to close the Add/Remove Snap-in window
Step 3: Navigate to the Certificate Store
– In the MMC, expand the «Certificates (Local Computer)» node
– Expand the «Personal» folder
– Click on the «Certificates» folder
Step 4: Find and Remove the Old SSL Certificate
– Locate the old SSL certificate you want to remove
– Right-click on the certificate and choose «Delete«
– Confirm the deletion when prompted
Step 5: Update the Certificate Binding (if necessary)
– If the old SSL certificate was being used for a specific service (e.g., IIS), you need to update the certificate binding to use a new certificate. This step may vary depending on the server application you are using.
Step 6: Restart the Server (if necessary)
– In some cases, a server restart may be required for the changes to take effect. Make sure to plan and communicate any potential downtime in advance.
Please note that the steps provided here are general guidelines, and you should always refer to the official documentation or consult an expert for specific instructions related to your server environment.
How do I find certificates on Windows Server?
To find certificates on Windows Server, you can follow these steps:
1. Open the Microsoft Management Console (MMC) by pressing the Windows key + R, then typing «mmc» and hitting enter.
2. In the MMC, go to File and select Add/Remove Snap-in.
3. In the Add or Remove Snap-ins window, select Certificates and click on the Add button.
4. In the Certificates snap-in window, choose the account you want to manage certificates for, i.e., Current User or Computer Account.
5. In the next screen, select Local Computer or User, depending on your requirements, and click Finish.
6. Click OK to close the Add or Remove Snap-ins window.
7. In the MMC, expand Certificates to view the available certificate stores, such as Personal, Trusted Root Certification Authorities, etc.
8. Expand the appropriate certificate store to view the certificates within it.
9. You can now manage certificates, such as importing, exporting, or deleting them, by right-clicking on the specific certificate.
Please note that the exact steps may vary depending on the specific version of Windows Server you are using, but these general steps should help you locate and manage certificates on most Windows Server editions. It’s always recommended to consult relevant documentation or online resources for your specific version if you encounter any difficulties.
How do I remove SSL certificate from Windows Server 2019?
To remove an SSL certificate from Windows Server 2019, you can follow the steps provided below:
1. Open the Microsoft Management Console (MMC) by pressing the Windows key + R, typing «mmc» in the Run dialog box, and hitting Enter.
2. In the MMC window, click on «File» in the top menu and select «Add/Remove Snap-in.«
3. In the Add or Remove Snap-ins dialog box, select «Certificates» and click on the «Add» button.
4. Choose the «Computer Account» option and click «Next.«
5. Select «Local Computer» and click «Finish» and then «OK» to close the dialog box.
6. In the MMC window, expand the «Certificates (Local Computer)» tree and navigate to the «Personal» > «Certificates» folder.
7. Locate the SSL certificate that you want to remove, right-click on it, and select «Delete.«
8. Confirm the deletion when prompted.
By following these steps, you can effectively remove an SSL certificate from Windows Server 2019.
How do I disable SSL 2.0 and 3.0 on Windows server 2019?
To disable SSL 2.0 and 3.0 on a Windows Server 2019, you can follow these steps:
1. Open the Windows Server Manager by clicking on the Start menu, searching for «Server Manager,» and selecting the corresponding result.
2. In the Server Manager window, navigate to the left-hand pane and select «Local Server.«
3. On the right-hand side, you will see the properties of the local server. Look for the section labeled «Properties» and click on the link labeled «On» next to «IE Enhanced Security Configuration.«
4. In the Internet Explorer Enhanced Security Configuration window, ensure that the settings are turned off for both administrators and users (unless you have specific reasons to enable them).
5. Next, open the Start menu, search for «Internet Options,» and select the corresponding result.
6. In the Internet Properties window, navigate to the «Advanced» tab.
7. In the settings list, locate the security section. Look for the options labeled «Use SSL 2.0» and «Use SSL 3.0.» Uncheck both options.
8. Click on the «Apply» button to save the changes, and then click «OK» to close the Internet Properties window.
9. Finally, restart your server to apply the changes.
Following these steps will disable SSL 2.0 and 3.0 on your Windows Server 2019. It is important to disable these outdated SSL versions to ensure better security and compatibility with modern web standards.
SSL certificates are typically stored in specific locations depending on the type of server or system being used. Here are the common locations where SSL certificates are stored:
1. Web Servers: In the case of web servers like Apache or Nginx, SSL certificates are usually stored in a designated directory on the server’s file system. The specific location can vary based on the server configuration, but it is commonly found in directories such as «/etc/ssl» or «/etc/apache2/ssl«.
2. Certificate Authorities (CAs): Certificate Authorities store SSL certificates in their certificate stores or databases. These certificates are used to issue and manage SSL certificates for the clients and servers that rely on their services.
3. Operating Systems: Some operating systems have their own certificate stores where SSL certificates can be stored. For instance, on Windows systems, SSL certificates can be managed through the Certificate Manager tool, which stores certificates in various locations such as the «trusted root certification authorities» or «personal» certificate stores.
4. Key and Certificate Stores: In some cases, SSL certificates are stored in specific key and certificate stores. These stores provide a secure and centralized location for storing keys, certificates, and associated metadata. For example, on Linux systems, OpenSSL can use a key and certificate store called «pkcs12» or «pfx» file format, which is password-protected and can contain both the private key and the corresponding SSL certificate.
5. Cloud Services: In cloud environments or when using Content Delivery Networks (CDNs), SSL certificates are often managed through their respective platforms. Popular cloud service providers like AWS, Azure, or Google Cloud Platform offer certificate management services or integrations that store and manage SSL certificates within their infrastructure.
It’s important to note that the specific storage location and mechanism may vary depending on the server, system, or application being used. The above list gives a general overview of common storage locations for SSL certificates in various contexts.
Windows Server 2016 is a widely-used operating system for server infrastructure. One of the essential aspects of server security is managing certificates. Certificates are digital documents that verify the authenticity and integrity of a website or server. They are crucial for encrypting data and ensuring secure communication. In this blog post, we will explore the challenge of checking installed certificates on Windows Server 2016 and provide various methods to accomplish this task effectively.
Video Tutorial:
The Challenge of Checking Installed Certificates on Windows Server 2016
When dealing with a Windows Server 2016 environment, it is important to be able to check and manage the installed certificates. This allows system administrators to ensure that the server’s security is up to par and that all necessary certificates are in place. However, the process of checking installed certificates can be challenging, especially for those who are new to managing server infrastructure.
Things You Should Prepare for
Before we dive into the methods of checking installed certificates, there are a few things you should prepare for. First and foremost, make sure you have administrative access to the Windows Server 2016 system. Without administrative privileges, you won’t be able to perform the necessary tasks. Additionally, it is essential to have a basic understanding of the Certificate Manager console and the purpose of certificates in general. This will help you navigate through the various methods more effectively.
Method 1: Using MMC (Microsoft Management Console)
Explanation: The MMC (Microsoft Management Console) provides a comprehensive interface for managing various aspects of a Windows Server. It also allows you to view and manage installed certificates.
Steps:
1. Press the Windows key + R to open the Run dialog box.
2. Type «mmc.exe» and press Enter to open the Microsoft Management Console.
3. In the MMC window, click on «File» in the top-left corner, and then click on «Add/Remove Snap-in.«
4. In the Add or Remove Snap-ins window, select «Certificates» from the list of available snap-ins and click on «Add.«
5. In the Certificates snap-in window, select «Computer account» and click on «Next.«
6. In the Select Computer window, leave the default setting (Local computer) selected and click on «Finish.«
7. Back in the Add or Remove Snap-ins window, click on «OK.«
8. In the MMC window, expand the «Certificates (Local Computer)» node in the left-hand pane to view the installed certificates.
Pros:
1. The MMC provides a centralized and comprehensive interface for managing various aspects of a Windows Server.
2. It allows easy access to view and manage installed certificates.
3. The Computer account option ensures that you are viewing certificates for the local computer, which may be important in multi-server environments.
Cons:
1. The MMC can be overwhelming for those unfamiliar with its interface and functionality.
2. It requires administrative access to the server.
Method 2: Via PowerShell
Explanation: PowerShell is a powerful scripting language and command-line shell that is integral to managing Windows Server systems. You can use PowerShell commands to check for installed certificates on Windows Server 2016.
Steps:
1. Open PowerShell by typing «powershell» in the Start menu search bar and selecting the Windows PowerShell app.
2. In the PowerShell console, type the following command and press Enter:
Get-ChildItem -Path cert:\LocalMachine\My
3. The command will retrieve a list of certificates installed in the «My» certificate store on the local machine.
Pros:
1. PowerShell provides a command-line interface for performing various administrative tasks, including checking installed certificates.
2. The command is simple and easy to remember.
Cons:
1. PowerShell commands may be unfamiliar to those who are not well-versed in scripting or command-line interfaces.
2. PowerShell requires administrative access to the server.
Method 3: Using Certutil
Explanation: Certutil is a command-line utility provided by Windows that allows you to manage certificates. It can be used to check installed certificates on Windows Server 2016.
Steps:
1. Open a Command Prompt by typing «cmd» in the Start menu search bar and selecting the Command Prompt app.
2. In the Command Prompt, type the following command and press Enter:
certutil -store My
3. The command will display a list of certificates installed in the «My» certificate store.
Pros:
1. Certutil is a built-in utility in Windows Server, so there is no need to install any additional software.
2. The command is simple and easy to remember.
Cons:
1. Command-line utilities like Certutil may be unfamiliar to those who are not comfortable working in a command-line interface.
2. Administrative access is required to use Certutil.
Method 4: Using Internet Information Services (IIS) Manager
Explanation: If your Windows Server 2016 system is running IIS (Internet Information Services), you can use the IIS Manager to check for installed certificates. This method is especially useful if you want to manage certificates specifically for websites hosted on the server.
Steps:
1. Open the Internet Information Services (IIS) Manager by typing «inetmgr» in the Start menu search bar and selecting the Internet Information Services (IIS) Manager app.
2. In the IIS Manager, expand the server node in the left-hand pane.
3. Expand the «Server Certificates» node to view the installed certificates.
Pros:
1. The IIS Manager provides a user-friendly interface for managing certificates, especially for websites hosted on the server.
2. It allows for easy access to view and manage installed certificates.
Cons:
1. This method is only applicable if your Windows Server 2016 system is running IIS.
2. Administrative access is required to use the IIS Manager.
There could be several reasons why you may encounter difficulties checking installed certificates on Windows Server 2016. Here are some common reasons and their respective fixes:
1. Reason: Lack of administrative access.
Fix: Ensure that you have administrative privileges on the server to perform the necessary tasks.
2. Reason: Missing or outdated software.
Fix: Make sure that the required software, such as MMC or IIS, is installed and up to date. Update the software or reinstall it if necessary.
3. Reason: Incompatibility with older versions of Windows Server.
Fix: If you are using an older version of Windows Server, some methods may not be applicable. Use the appropriate method for your specific version.
Additional Tips
Here are some additional tips to help you effectively check installed certificates on Windows Server 2016:
1. Regularly review and update certificates: Certificates expire after a certain period, so it is crucial to regularly review and renew them to ensure continued security.
2. Use certificate management tools: Consider using third-party certificate management tools that provide enhanced functionality and ease of use.
3. Implement a certificate lifecycle management process: Establish a process for managing the lifecycle of certificates, including creation, installation, renewal, and revocation.
5 FAQs about Checking Installed Certificates on Windows Server 2016
Q1: Can I check installed certificates on Windows Server 2016 without administrative access?
A: No, administrative privileges are required to perform tasks related to certificate management on Windows Server 2016.
Q2: Are the methods discussed in this blog post applicable to other versions of Windows Server?
A: Yes, the methods mentioned in this blog post can also be used for other versions of Windows Server, with slight variations based on the specific interfaces and utilities available.
Q3: Is it necessary to regularly update certificates on a Windows Server 2016 system?
A: Yes, certificates have expiration dates, and it is important to regularly review and renew them to maintain secure communication.
Q4: Can I use third-party certificate management tools instead of the built-in methods?
A: Yes, using third-party certificate management tools can provide additional features and ease of use.
Q5: Is it possible to manage certificates for websites hosted on Windows Server 2016 using the IIS Manager?
A: Yes, the IIS Manager allows you to manage certificates specifically for websites hosted on your Windows Server 2016 system.
In Conclusion
Checking installed certificates on Windows Server 2016 is a crucial task for maintaining server security and ensuring secure communication. We have explored several methods, including using the MMC, PowerShell, Certutil, and the IIS Manager. Each method has its pros and cons, and the choice depends on individual preferences and the specific requirements of the server environment. By following the outlined steps and considering the additional tips, you can effectively check installed certificates on your Windows Server 2016 system and ensure a secure server infrastructure.
Данный материал является переводом оригинальной статьи «ATA Learning : Michael Soule : Manage Certs with Windows Certificate Manager and PowerShell».
Работа с сертификатами обычно является одной из тех дополнительных задач, которые вынужден брать на себя системный администратор Windows. Диспетчер Сертификатов Windows (Windows Certificate Manager) — это один из основных инструментов, который позволяет выполнять эту работу.
В этой статье мы рассмотрим работу с сертификатами применительно к операционной системе Windows. Если же вы хотите узнать больше о том, как работают сертификаты в целом, ознакомьтесь с сопутствующей статьей «Your Guide to X509 Certificates».
Понимание хранилищ сертификатов
В диспетчере сертификатов Windows все сертификаты находятся в логических хранилищах, называемых «хранилищами сертификатов». Хранилища сертификатов – это «корзины», в которых Windows хранит все сертификаты, которые в настоящее время установлены, и сертификат может находиться более чем в одном хранилище.
К сожалению, хранилища сертификатов — не самая интуитивно понятная концепция для работы. О том, как различать эти хранилища и как с ними работать, вы прочитаете ниже.
Каждое хранилище находится в Реестре Windows и в файловой системе. При работе с сертификатом в хранилище вы взаимодействуете с логическим хранилищем, не изменяя напрямую реестр или файловую систему. Этот более простой способ позволяет вам работать с одним объектом, в то время как Windows заботится о том, как представить этот объект на диске.
Иногда можно встретить хранилища сертификатов, называемые физическими или логическими хранилищами. Физические хранилища ссылаются на фактическую файловую систему или место в реестре, где хранятся разделы реестра и / или файл(ы). Логические хранилища — это динамические ссылки, которые ссылаются на одно или несколько физических хранилищ. С логическими хранилищами намного проще работать, чем с физическими хранилищами для наиболее распространенных случаев использования.
Windows хранит сертификаты в двух разных областях — в контексте пользователя и компьютера. Сертификат помещается в один из этих двух контекстов в зависимости от того, должен ли сертификат использоваться одним пользователем, несколькими пользователями или самим компьютером. В остальной части этой статьи сертификат в контексте пользователя и компьютера будет неофициально называться сертификатами пользователей и сертификатами компьютеров.
Сертификаты пользователей
Если вы хотите, чтобы сертификат использовался одним пользователем, то идеальным вариантом будет хранилище пользовательских сертификатов внутри Диспетчера сертификатов Windows. Это общий вариант использования процессов аутентификации на основе сертификатов, таких как проводной IEEE 802.1x.
Сертификаты пользователей находятся в профиле текущего пользователя и логически отображаются только в контексте этого пользователя. Сертификаты пользователей «сопоставлены» и уникальны для каждого пользователя даже в одних и тех же системах.
Компьютерные сертификаты
Если сертификат будет использоваться всеми пользователями компьютера или каким-либо системным процессом, его следует поместить в хранилище в контексте компьютера. Например, если сертификат будет использоваться на веб-сервере для шифрования связи для всех клиентов, размещение сертификата в контексте компьютера будет подходящим вариантом.
Вы увидите, что хранилище сертификатов компьютера логически сопоставлено для всех пользовательских контекстов. Это позволяет всем пользователям использовать сертификаты в хранилище сертификатов компьютера в зависимости от разрешений, настроенных для закрытого ключа.
Сертификаты компьютера находятся в кусте реестра локального компьютера и в подкаталогах \ProgramData. Сертификаты пользователя находятся в кусте реестра текущего пользователя и в подкаталогах \AppData. Ниже вы можете увидеть, где каждый тип хранилища находится в реестре и файловой системе.
Контекст | Путь реестра | Объяснение |
---|---|---|
User | HKEY_CURRENT_USER SOFTWARE\Microsoft\SystemCertificates\ |
Физическое хранилище для пользовательских открытых ключей |
User | HKEY_CURRENT_USER SOFTWARE\Policies\Microsoft\SystemCertificates\ |
Физическое хранилище для пользовательских открытых ключей, установленных объектами групповой политики Active Directory (AD) (GPO) |
Computer | HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\SystemCertificates\ |
Физическое хранилище общедоступных ключей для всей машины |
Computer | HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Cryptography\Services\ |
Физическое хранилище ключей, связанных с определенной службой |
Computer | HKEY_LOCAL_MACHINE SOFTWARE\Policies\Microsoft\SystemCertificates\ |
Физическое хранилище открытых ключей для всей машины, установленных объектами групповой политики. |
Computer | HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\EnterpriseCertificates\ |
Физическое хранилище общедоступных ключей, установленных корпоративными контейнерами PKI в домене AD |
Контекст | Расположение файла | Объяснение |
---|---|---|
User | $env:APPDATA\Microsoft\SystemCertificates\ | Физическое хранилище для пользовательских открытых ключей и указателей на закрытые ключи |
User | $env:APPDATA\Microsoft\Crypto\ | Физическое хранилище для контейнеров закрытых ключей для конкретных пользователей |
Computer | $env:ProgramData\Microsoft\Crypto\ | Физическое хранилище для контейнеров закрытых ключей для всей машины |
Предварительные требования
В оставшейся части этой статьи вы найдете несколько примеров, демонстрирующих взаимодействие с хранилищами сертификатов Windows. Чтобы воспроизвести эти примеры, убедитесь, что выполняются следующие требования:
- Windows Vista, Windows Server 2008 или более новая операционная система. В показанных примерах используется Windows 10 Корпоративная версии 1903.
- Знакомство с PowerShell. Хотя это и не обязательно, этот язык будет использоваться для ссылки на сертификаты, где это необходимо. Все показанные примеры были созданы с помощью Windows PowerShell 5.1.
- Вам не потребуется устанавливать какие-либо специальные сертификаты, но использование самозаверяющего сертификата полезно.
Управление сертификатами в Windows
В Windows есть три основных способа управления сертификатами:
- Оснастка консоли управления Microsoft (MMC) сертификатов (certmgr.msc)
- PowerShell
- Инструмент командной строки certutil
В этой статье вы узнаете, как управлять сертификатами с помощью оснастки Certificates MMC и PowerShell. Если вы хотите узнать больше о том, как использовать certutil, ознакомьтесь с документацией Microsoft.
PowerShell против диспетчера сертификатов Windows
Поскольку в Windows можно управлять сертификатами несколькими способами, встаёт вопрос выбора, что лучше использовать — GUI (MMC) или командную строку с PowerShell.
Во-первых, рассмотрим жизненный цикл сертификата. Если вы собираетесь установить или удалить один сертификат только один раз, рассмотрите возможность использования MMC. Но если вы управляете несколькими сертификатами или выполняете одну и ту же задачу снова и снова, использование командной строки может оказаться правильным решением. Даже если вы не умеете писать сценарии PowerShell, вам стоит этому научиться, если у вас есть много разных сертификатов, которыми нужно управлять.
Давайте сначала посмотрим, как обнаружить сертификаты, установленные в Windows, с помощью диспетчера сертификатов и PowerShell.
Использование диспетчера сертификатов Windows (certmgr.msc)
Чтобы просмотреть сертификаты с помощью MMC, откройте Диспетчер сертификатов: откройте меню «Пуск» и введите certmgr.msc. Это вызовет Windows Certificates MMC. Это начальное представление предоставит обзор всех логических хранилищ, отображаемых в левом окне.
На снимке экрана ниже видно, что выбрано логическое хранилище доверенных корневых центров сертификации
Просмотр физических хранилищ
По умолчанию Диспетчер сертификатов Windows не отображает физические хранилища. Чтобы показать их, в верхнем меню оснастки выбирайте «View» > «Options«. Затем вы увидите варианты отображения физических хранилищ сертификатов. Включение этого параметра упрощает определение конкретных путей в Windows.
Теперь вы можете видеть, что дополнительные контейнеры показаны в примере логического хранилища доверенных корневых центров сертификации, показанном ранее. Сертификаты по-прежнему сгруппированы относительно их логических хранилищ, но теперь вы можете увидеть физическое хранилище «Реестр».
Проверка атрибутов в диспетчере сертификатов Windows
Есть много атрибутов сертификата, которые вы можете увидеть при просмотре их с помощью MMC. Например, вы, вероятно, захотите выбрать определенные сертификаты по их атрибутам. Самый простой способ сделать это — указать Serial Number сертификата или значение Thumbprint. Если сертификат был подписан центром сертификации (CA), при выдаче он будет иметь серийный номер. Thumbprint вычисляется каждый раз при просмотре сертификата.
Вы можете увидеть некоторые атрибуты сертификата, открыв его в MMC, как показано ниже.
Следует отметить одну важную особенность — встроенные закрытые ключи. Сертификаты в Windows также могут иметь соответствующий закрытый ключ. Эти закрытые ключи хранятся в соответствующих физических хранилищах в виде зашифрованных файлов.
Чтобы быстро отличать сертификаты с соответствующим закрытым ключом и без него, посмотрите на значок сертификата. В Диспетчере сертификатов Windows, если значок просто выглядит как лист бумаги с лентой, соответствующий закрытый ключ отсутствует. Если у сертификата есть закрытый ключ, вы увидите ключ на значке MMC, и ключ в нижней части вкладки «Общие» при открытии сертификата
Использование PowerShell по физическому хранилищу
Как и в случае с MMC, вы можете просматривать сертификаты и управлять ими с помощью PowerShell. Давайте сначала проверим сертификаты в их физических хранилищах (реестр и файловая система).
Используя PowerShell командлет Get-ChildItem, вы можете перечислить все ключи и значения внутри родительского пути в реестре. Приведенная ниже команда перечислит все сертификаты вошедшего в систему пользователя в логическом хранилище промежуточных центров сертификации.
Get-ChildItem -Path 'HKCU:\Software\Microsoft\SystemCertificates\CA\Certificates'
Каждая запись в кусте реестра, который вы видите, будет соответствовать отпечатку сертификата доверенного центра сертификации и его сертификату в соответствующем свойстве. Вы можете увидеть пример вывода ниже.
Другое распространенное хранилище — это Personal store. Ваши сертификаты для этого хранилища находятся в файловой системе, а не в реестре. В следующих командах мы покажем эти различные физические пути и их цели.
Каждый файл в каталоге, возвращенный приведенной ниже командой, соответствует сертификату, установленному в личном хранилище текущего пользователя.
Get-ChildItem -Path $env:APPDATA\Microsoft\SystemCertificates\My\Certificates\
Каждый файл, возвращаемый в приведенной ниже команде, является ссылкой на объект для закрытого ключа, созданный поставщиком хранилища ключей (KSP). Имя файла соответствует идентификатору ключа субъекта сертификата. К каждому устанавливаемому вами закрытому ключу будет добавлен соответствующий файл.
Get-ChildItem -Path $env:APPDATA\Microsoft\SystemCertificates\My\Keys\
Каждый файл в каталоге, возвращаемый следующей командой, является уникальным контейнером для зашифрованного закрытого ключа, созданного KSP. Нет прямой связи между именем файла и сертификатом, но файл является целью указателя в предыдущей команде.
Get-ChildItem -Path $env:APPDATA\Microsoft\Crypto\Keys
Использование PowerShell по логическому хранилищу
Поскольку работа с сертификатами на их физических путях встречается редко, в остальных примерах вы будете работать с логическими хранилищами.
PowerShell может получить доступ к логическим хранилищам Windows с помощью PSDrive-объекта «Cert:\«, который сопоставляет сертификаты с физическими хранилищами так же, как это делает MMC.
К сожалению, MMC и «Cert:» не маркируют логические хранилища одинаково. Ниже вы можете увидеть сравнительную таблицу общих хранилищ и их названий как в MMC, так и в «Cert:» PSDrive.
Cert: | Certificates MMC |
---|---|
My | Personal |
Remote Desktop | Remote Desktop |
Root | Trusted Root Certification Authorities |
CA | Intermediate Certification Authorities |
AuthRoot | Third-Party Root Certification Authorities |
TrustedPublisher | Trusted Publishers |
Trust | Enterprise Trust |
UserDS | Active Directory User Object |
Выбор сертификатов
Когда вы работаете с сертификатами, вам понадобится способ фильтрации и выбора сертификатов для выполнения определенных операций. В большинстве случаев вы будете фильтровать и выбирать сертификаты на основе значения определенного расширения.
Для следующих примеров вам нужно начать с перечисления всех установленных сертификатов в хранилище корневого ЦС.
Get-ChildItem -Path 'Cert:\CurrentUser\Root\'
Возвращенные объекты будут объектами сертификатов, которые вы можете использовать в следующих примерах.
Общие расширения уже доступны как свойства объектов сертификата. В приведенном ниже примере вы используете Get-Member для вывода списка всех свойств возвращаемых объектов.
Get-ChildItem -Path 'Cert:\CurrentUser\Root\' | Get-Member -MemberType Properties
Как видим, некоторые из этих расширений, например «Issuer», помогают найти сертификат, который вы ищете. Расширения предоставляют информацию о сертификате, например, кому он выдан, для чего его можно использовать и любые ограничения на него.
В более сложных случаях использования вам может понадобиться найти сертификаты других расширений, таких как используемый шаблон сертификата. Сложность в том, что значения этих расширений возвращаются как массив целых чисел. Эти целые числа соответствуют содержимому в кодировке ASN.1.
Покажем пример взаимодействия с свойствами типа ScriptProperty. В приведенной ниже команде вы извлекаете Key Usages.
((Get-ChildItem -Path 'Cert:\CurrentUser\Root\' | Select -First 1).Extensions | Where-Object {$_.Oid.FriendlyName -eq 'Key Usage'}).format($true)
Новая часть, которую мы вводим в приведенной выше команде, — это метод форматирования, который выполняет декодирование ASN.1. Вы передаете ему логическое значение (например, $true), чтобы определить, хотим ли мы, чтобы возвращаемый объект был однострочным или многострочным.
Попробуем использовать значение Thumbprint из сертификата в приведенной ниже команде. Значение Thumbprint устанавливается как переменная PowerShell и используется для выбора конкретного сертификата в приведенных ниже командах.
$thumb = "cdd4eeae6000ac7f40c3802c171e30148030c072"
Get-ChildItem -Path 'Cert:\CurrentUser\Root\' | Where-Object {$_.Thumbprint -eq $thumb}
Создание самозаверяющих (self-signed) сертификатов с помощью PowerShell
PowerShell может создавать самозаверяющие (self-signed) сертификаты с помощью командлета New-SelfSignedCertificate. Самозаверяющие сертификаты полезны для тестирования, поскольку они позволяют генерировать пару открытого и закрытого ключей без использования центра сертификации.
Теперь давайте создадим самозаверяющий сертификат в хранилищах текущего пользователя и локального компьютера, чтобы использовать его в примерах для следующих шагов.
В приведенном ниже примере PowerShell создает пару открытого и закрытого ключей, самозаверяющий сертификат и устанавливает их все в соответствующие хранилища сертификатов.
New-SelfSignedCertificate -Subject 'User-Test' -CertStoreLocation 'Cert:\CurrentUser\My'
New-SelfSignedCertificate -Subject 'Computer-Test' -CertStoreLocation 'Cert:\LocalMachine\My'
Использование самозаверяющих сертификатов для продуктивных сервисов не рекомендуется, поскольку не существует всех механизмов, основанных на доверии.
Импорт и экспорт сертификатов в MMC
Криптография с открытым ключом основана на широкой доступности открытого ключа. Учитывая это, вам нужны стандартные способы эффективного обмена сертификатами. Не менее важна безопасность ваших личных ключей. Хранение закрытых ключей на недоступных носителях или с материалами для аварийного восстановления — обычная практика для определенных закрытых ключей.
Оба они требуют способов хранения этих криптографических объектов в стандартных форматах. Экспорт предоставляет функции для сохранения этих объектов и обеспечения использования широко распространенных стандартных форматов файлов. Импорт позволяет вам переносить криптографические объекты в операционные системы Windows.
Экспорт сертификатов из MMC относительно прост. Чтобы экспортировать сертификат без закрытого ключа, щелкните сертификат в MMC, выберите меню «Все задачи», а затем «Экспорт».
Во время экспорта вам будет предложено указать формат файла, как показано ниже. Наиболее распространены варианты кодирования — DER или Base-64
Экспорт закрытых ключей
Чтобы экспортировать сертификат с соответствующим закрытым ключом, вы должны соответствовать двум критериям:
- Вошедшая в систему учетная запись должна иметь разрешение на закрытый ключ (только для сертификатов компьютеров);
- Закрытый ключ должен быть помечен как экспортируемый.
Чтобы проверить разрешения для закрытых ключей локального компьютера, вы можете выбрать сертификат с закрытым ключом, выбрать «Все задачи» и «Управление закрытыми ключами» в MMC «Сертификаты». В открывшемся диалоговом окне отображаются записи управления доступом для закрытых ключей.
Когда выше обозначенные условия выполнены, вы можете выбрать сертификат, щелкнуть «Все задачи», а затем «Экспорт», как если бы вы использовали сертификат только с открытым ключом. При экспорте теперь у вас должна присутствовать возможность выбора экспорта закрытого ключа («Yes, export the private key»), как показано ниже.
Когда вы экспортируете закрытый ключ в Windows, вы можете сохранить файл только как PFX. Этот и другие типы файлов и форматы кодирования подробно описаны в этом посте.
Для остальных параметров, отображаемых в мастере экспорта, вы можете использовать значения по умолчанию. В таблице ниже приводится краткое изложение каждого из них.
Настройка | Описание |
---|---|
Including all certificates in the certification path if possible | Помогает с переносимостью эмитентов сертификатов и включает все соответствующие открытые ключи в PFX. |
Delete the private key if the export is successful | Удаляет закрытый ключ из файла и имеет несколько распространенных вариантов использования, но одним из примеров является проверка доступа к закрытым ключам. |
Export all extended properties | Будет включать любые расширения в текущем сертификате, они относятся к сертификатам [конкретные настройки] для интерфейсов Windows. |
Enable certificate privacy | Обычно в экспортируемом PFX-файле шифруется только закрытый ключ, этот параметр шифрует все содержимое PFX-файла. |
Group or user names | Вы можете использовать участника безопасности группы или пользователя из Active Directory для шифрования содержимого файла PFX, но пароль является наиболее переносимым вариантом для устаревших систем или компьютеров, не присоединенных к тому же домену. |
Импорт сертификатов
Функция импорта одинакова для всех поддерживаемых типов файлов сертификатов. Единственная разница в том, что если файл содержит закрытый ключ, вы можете «Отметить этот ключ как экспортируемый», о чем вы узнаете подробнее ниже. Windows будет использовать мастер импорта сертификатов.
При использовании мастера импорта сертификатов для PFX вам потребуется указать пароль, используемый для шифрования закрытого ключа. Вот еще один обзор вариантов импорта.
Настройка | Описание |
---|---|
Enable strong private key protection | Требуется пароль для каждого доступа к закрытому ключу. Будьте осторожны с новыми функциями, поскольку они не будут поддерживаться во всех программах. |
Mark this key as exportable | Вы должны стараться избегать использования этого параметра в любой конечной системе, закрытые ключи следует рассматривать так же, как и хранение паролей. |
Protect private key using [virtualization-based security] | Этот параметр обеспечивает дополнительные функции безопасности для защиты закрытых ключей от сложных атак вредоносного ПО. |
Include all extended properties | Относится к тем же настройкам Windows, что и при экспорте. |
Сертификаты для подписи кода PowerShell — хороший вариант использования надежной защиты закрытого ключа.
С автоматическим размещением сертификатов следует проявлять осторожность. Скорее всего, вы получите наилучшие результаты, выбрав хранилище сертификатов вручную.
Импорт и экспорт сертификатов в PowerShell
Теперь с помощью PowerShell экспортируйте один из самозаверяющих сертификатов, которые вы создали ранее. В этом примере вы выбираете сертификат в личном логическом хранилище CurrentUser, который был самозаверяющим.
$certificate = Get-Item (Get-ChildItem -Path 'Cert:\CurrentUser\My\' | Where-Object {$_.Subject -eq $_.Issuer}).PSPath
Теперь, когда вы выбрали сертификат, вы можете использовать команду Export-Certificate, чтобы сохранить файл в кодировке DER, используя команду ниже.
Export-Certificate -FilePath $env:USERPROFILE\Desktop\certificate.cer -Cert $certificate
Теперь давайте посмотрим на экспорт закрытого ключа. Ниже вы проверяете, что у выбранного сертификата есть закрытый ключ. Если он не возвращает True, то команда Get-Item, скорее всего, выбрала неправильный сертификат.
$certificate.HasPrivateKey
Ниже вы установите пароль, который будет использоваться для шифрования закрытого ключа. Затем экспортируйте выбранный сертификат в файл PFX и используйте пароль, который вы ввели ранее, чтобы зашифровать файл.
$pfxPassword = "ComplexPassword!" | ConvertTo-SecureString -AsPlainText -Force
Export-PfxCertificate -FilePath $env:USERPROFILE\Desktop\certificate.pfx -Password $pfxPassword -Cert $certificate
В случае, если необходимо выполнить импорт, как и при экспорте, есть две команды. Одна команда для импорта сертификатов и одна для импорта файлов PFX.
Ниже команда Import-Certificate импортирует файл в формате DER, который вы экспортировали ранее, в личное хранилище текущего пользователя.
Import-Certificate -FilePath $env:USERPROFILE\Desktop\certificate.cer -CertStoreLocation 'Cert:\CurrentUser\My'
Допустим, вы тоже хотите установить закрытый ключ этого сертификата.
$pfxPassword = "ComplexPassword!" | ConvertTo-SecureString -AsPlainText -Force
Import-PfxCertificate -Exportable -Password $pfxPassword -CertStoreLocation 'Cert:\CurrentUser\My' -FilePath $env:USERPROFILE\Desktop\certificate.pfx
Имейте в виду, что пароль должен быть защищенной строкой. Кроме того, если вы импортируете в хранилище локального компьютера (например, «Cert:\LocalMachine«), вам нужно будет запустить команду из командной строки администратора с повышенными привилегиями.
В приведенном выше примере вы также используете параметр -Exportable с командой, отмечая закрытый ключ как экспортируемый в будущем. По умолчанию (без указания этого параметра) экспорт не используется. Экспортируемые закрытые ключи – отельный аспект информационной безопасности, заслуживающий отдельного внимания.
Удаление сертификатов с помощью PowerShell
При удалении сертификатов помните, что понятие «Корзина Windows» в этом случае отсутствует. Как только вы удалите сертификат, он исчезнет! Это означает, что очень важно подтвердить, что вы удаляете правильный сертификат, путем проверки уникального идентификатора, такого как серийный номер или значение расширения Thumbprint.
Как и выше, в приведенной ниже команде мы выбираем самозаверяющий сертификат из личного хранилища текущего пользователя.
$certificate = Get-Item (Get-ChildItem -Path 'Cert:\CurrentUser\My\' | Where-Object {$_.Subject -eq $_.Issuer}).PSPath
Ниже вы можете увидеть свойства отпечатка, серийного номера и темы для выбранного сертификата, чтобы убедиться, что это именно тот сертификат, который вы собираетесь выбрать.
$certificate.Thumbprint
$certificate.SerialNumber
$certificate.Subject
Убедитесь, что вы выбрали правильный сертификат, который собираетесь удалить.
Приведенная ниже команда удаляет все выбранные объекты сертификата, используйте с осторожностью! Передав объект $certificate через конвейер в командлет Remove-Item в приведенной ниже команде, вы удалите все содержимое сертификата без каких-либо запросов на проверку.
$certificate | Remove-Item
Резюме
На протяжении всей этой статьи вы работали с сертификатами в Windows, изучая, как получить к ним доступ, и некоторые инструменты, которые можно использовать при работе с ними. По этой теме можно изучить гораздо больше, в том числе о том, как связать установленные сертификаты с конкретными службами или даже о том, как реализовать инфраструктуру закрытого открытого ключа (PKI) путем развертывания собственных центров сертификации (CA).
Do you run multiple websites? If yes, then you must be having multiple SSL certificates too, and SSL (Secure Sockets Layer) certificate is very much an essential part of any website, as it gives the user the feeling of being safe while they visit that particular site. And as a website owner, you need to manage different certificates from time to time, and therefore you need to locate them on the server. But, where to find an SSL certificate on the server?
Got no clue, right?
Well, let me help you with it.
So, if you want to find an SSL certificate on the server, you can either use your CA’s dashboard, or scan the Certificate Stores using third-party packet analyzers like; Wireshark and KeyFactor, or by using Windows inbuilt Microsoft Management Console or Windows Certificate Manager Tool.
Where is the SSL Certificate Stored?
Secure Sockets Layer certificate is stored in the Certificate Stores on Windows, Developer option on the Chrome browser, and in the “/etc/SSL/certs” folder on Linux.
Where is the SSL Certificate in the Windows Server?
SSL certificates are stored in Certificate Stores on Windows Servers. There are containers that store these certificates. Some containers hold one or more certificates according to the different types and they are;
- Personal: This container holds the certificate associated with the private keys to which a user has access.
- Trusted Root Certification: This type of container holds the certificates that includes all the certificates in the Third-Party Root Certification Authorities Store, plus from customer organization, and Microsoft Store.
- Intermediate Certification Authorities: This type of container holds those certificates which are issued to subordinate CA’s.
You can easily check your Windows server for SSL certificates by using Microsoft Management Console or by using Certificate Manager Tool, and to make it easy for you, I am providing you with a step-by-step guide.
Using Microsoft Management Console:
- Open Microsoft Management Console by opening the command prompt, then typing in “mcc” and hitting enter.
- Click on File from the menu, and select Add/Remove Snap-in.
- Now, select the certificates and press Add from the Snap-ins list.
- Select Computer account, and then click Next.
- Select Local Computer.
- Click on Finish.
- Click OK on the “Add or Remove Snap-in” window.
- Select a Certificates Store on the left side of the panel, to view your SSL certificate in the MMC snap-in.
- Double click on a certificate.
- A window will open up showing you the selected certificates and their various attributes.
Using Certificate Manager Tool:
- Open the command console.
- Then, type certlm.msc.
- Under “Certificates” on your local computer, expand the directory to search for the certificate type you want to view.
Where to buy an SSL Certificate?
So, if you are thinking to buy an SSL certificate, you can buy it from any Certificate Authority. CA is a trusted third party, that generates and gives out SSL certificates. The CA will also digitally sign the certificate with its own private key, which allows client devices to verify it.
Mostly, only a few CA’s will charge you money to issue an SSL certificate. Once the certificate is issued, it needs to be installed and activated on the server of the website, after that, the website will be able to load Https and the entire traffic will be encrypted and secure.
Some famous SSL providers include; Comodo SSL, DigiCert, Entrust Datacard, Geo trust, Global Sign, GoDaddy, Network Solutions, Rapid SSL, SSL.com, and Thawte.
What are the different types of SSL Certificates?
After this long discussion, you might be thinking about the types of SSL certificates that can be installed on a server. Well, there are multiple types of SSL certificates available, and are divided into two segments:
SSL based on validation level:
There are three main SSL validations;
- Domain Validated Certificate:
This type of certificate requires the lowest level of validation, as the main purpose of DV certificates is to secure communication between browser and web server.
- Organisation Validated Certificate:
This type of certificate is used at a medium level, as the CA checks the rights of the organization to use that domain and the organization’s information. It enhances the trust level of an organization and its domain.
- Extended Validated Certificate:
This type of certificate is a high-level validation, and therefore, CA conducts a rigorous background check according to the guidelines, which includes verification of the legal, operational, and physical existence of the organization.
SSL certificate based on the number of Domains.
Again, this segment also contains three levels of bifurcation:
- Single Domain Certificate:
This certificate only covers up one fully qualified domain or subdomain.
- Wildcard SSL certificate:
Wildcard SSL certificate covers one main domain and unlimited sub-domains.
- Multi-domain SSL certificate:
Multi-domain SSL certificate, as the name suggests, covers multiple domains, using the same certificate and the SAN extension. It is usually designed to secure Microsoft Exchange and Office Communication environments.
What are the signs of a running SSL certificate?
If you are a user and wonder if the site that you are using is SSL certified or not, you can simply look for these signs:
- Padlock to the left of the URL.
- Https instead of Http.
- A trust seal.
- A green address bar (when an EV SSL certificate is issued)
If you are a website owner and own multiple domains, you will surely need multiple SSL certificates to protect and encrypt your website data. Although sometimes having so many SSL certificates can lead to bewilderment, therefore it becomes crucial to locate the appropriate SSL certificate.
Therefore, using your CA’s dashboard or scanning the Certificate Stores by using inbuilt Windows tools or third-party packet analyzers is recommended.
Добрый день! На сервере истек SSL сертификат, но никак его не могу найти. Искал в IIS и certlm, пусто. Единстенная инфа которая есть по данному сертификату это CN=56844bc3-ec1c… и все
-
Вопрос задан
-
1676 просмотров
Если это сертификат сервера, открываете Win+R набираете mmc и добавляете оснастку Certificate, для Local PC. Сертификаты для IIS обычно лежат в Personal.
Пригласить эксперта
Оснастка «Сертификаты», раздел «Локальный компьютер» (не «Пользователь»!). Сертификат сервера должен находиться в папке «Личное».
Но обычно в этом нет необходимости — сертификат перевыпускается через IIS, если пользуетесь.
Войдите, чтобы написать ответ
-
Показать ещё
Загружается…