Unable to create a self signed Certificate for SQL Server 2017(14.x.xxxx)
Using SQL Server 2017 Developer Edition

The command I'm using is:
New-SelfSignedCertificate -CertStoreLocation Cert:LocalMachineMy -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert
The error message is:
New-SelfSignedCertificate : A parameter cannot be found that matches parameter name 'KeySpec'.
My powerShell version is:
PS C:Windowssystem32> $PSversionTable
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.18773
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
sql-server powershell certificate
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
|
show 3 more comments
Using SQL Server 2017 Developer Edition

The command I'm using is:
New-SelfSignedCertificate -CertStoreLocation Cert:LocalMachineMy -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert
The error message is:
New-SelfSignedCertificate : A parameter cannot be found that matches parameter name 'KeySpec'.
My powerShell version is:
PS C:Windowssystem32> $PSversionTable
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.18773
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
sql-server powershell certificate
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Do you have spelling mistake inhost.domain.com?
– SqlWorldWide
Apr 26 '18 at 11:46
well yes that was I typo but still the error is same.
– Azhar Kalam
Apr 26 '18 at 13:00
Can you try this commans?New-SelfSignedCertificate -CertStoreLocation Cert:CurrentUserMy -DnsName host.domain.com -KeySpec KeyExchange -FriendlyName SQLCert
– SqlWorldWide
Apr 26 '18 at 13:20
Tried still the same error!
– Azhar Kalam
Apr 26 '18 at 13:28
Try wrapping the cert store location in quotes:New-SelfSignedCertificate -CertStoreLocation "Cert:LocalMachineMy" -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert
– Max Vernon
Apr 26 '18 at 14:53
|
show 3 more comments
Using SQL Server 2017 Developer Edition

The command I'm using is:
New-SelfSignedCertificate -CertStoreLocation Cert:LocalMachineMy -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert
The error message is:
New-SelfSignedCertificate : A parameter cannot be found that matches parameter name 'KeySpec'.
My powerShell version is:
PS C:Windowssystem32> $PSversionTable
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.18773
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
sql-server powershell certificate
Using SQL Server 2017 Developer Edition

The command I'm using is:
New-SelfSignedCertificate -CertStoreLocation Cert:LocalMachineMy -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert
The error message is:
New-SelfSignedCertificate : A parameter cannot be found that matches parameter name 'KeySpec'.
My powerShell version is:
PS C:Windowssystem32> $PSversionTable
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.18773
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
sql-server powershell certificate
sql-server powershell certificate
edited Apr 26 '18 at 17:21
Sean Gallardy
15.8k22548
15.8k22548
asked Apr 26 '18 at 10:08
Azhar KalamAzhar Kalam
112
112
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Do you have spelling mistake inhost.domain.com?
– SqlWorldWide
Apr 26 '18 at 11:46
well yes that was I typo but still the error is same.
– Azhar Kalam
Apr 26 '18 at 13:00
Can you try this commans?New-SelfSignedCertificate -CertStoreLocation Cert:CurrentUserMy -DnsName host.domain.com -KeySpec KeyExchange -FriendlyName SQLCert
– SqlWorldWide
Apr 26 '18 at 13:20
Tried still the same error!
– Azhar Kalam
Apr 26 '18 at 13:28
Try wrapping the cert store location in quotes:New-SelfSignedCertificate -CertStoreLocation "Cert:LocalMachineMy" -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert
– Max Vernon
Apr 26 '18 at 14:53
|
show 3 more comments
Do you have spelling mistake inhost.domain.com?
– SqlWorldWide
Apr 26 '18 at 11:46
well yes that was I typo but still the error is same.
– Azhar Kalam
Apr 26 '18 at 13:00
Can you try this commans?New-SelfSignedCertificate -CertStoreLocation Cert:CurrentUserMy -DnsName host.domain.com -KeySpec KeyExchange -FriendlyName SQLCert
– SqlWorldWide
Apr 26 '18 at 13:20
Tried still the same error!
– Azhar Kalam
Apr 26 '18 at 13:28
Try wrapping the cert store location in quotes:New-SelfSignedCertificate -CertStoreLocation "Cert:LocalMachineMy" -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert
– Max Vernon
Apr 26 '18 at 14:53
Do you have spelling mistake in
host.domain.com?– SqlWorldWide
Apr 26 '18 at 11:46
Do you have spelling mistake in
host.domain.com?– SqlWorldWide
Apr 26 '18 at 11:46
well yes that was I typo but still the error is same.
– Azhar Kalam
Apr 26 '18 at 13:00
well yes that was I typo but still the error is same.
– Azhar Kalam
Apr 26 '18 at 13:00
Can you try this commans?
New-SelfSignedCertificate -CertStoreLocation Cert:CurrentUserMy -DnsName host.domain.com -KeySpec KeyExchange -FriendlyName SQLCert– SqlWorldWide
Apr 26 '18 at 13:20
Can you try this commans?
New-SelfSignedCertificate -CertStoreLocation Cert:CurrentUserMy -DnsName host.domain.com -KeySpec KeyExchange -FriendlyName SQLCert– SqlWorldWide
Apr 26 '18 at 13:20
Tried still the same error!
– Azhar Kalam
Apr 26 '18 at 13:28
Tried still the same error!
– Azhar Kalam
Apr 26 '18 at 13:28
Try wrapping the cert store location in quotes:
New-SelfSignedCertificate -CertStoreLocation "Cert:LocalMachineMy" -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert– Max Vernon
Apr 26 '18 at 14:53
Try wrapping the cert store location in quotes:
New-SelfSignedCertificate -CertStoreLocation "Cert:LocalMachineMy" -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert– Max Vernon
Apr 26 '18 at 14:53
|
show 3 more comments
2 Answers
2
active
oldest
votes
You need to enclose CertStoreLocation, Subject, DnsName and FriendlyName with double quotes.
There is no need to specify a location as it will default to "Local Computer/Personal/Certificates" where it needs to be in order to use it by SQL Server.
This will generate a valid certificate on Windows Server 2016 that will be usable by SQL Server 2017:
New-SelfSignedCertificate -Subject "CN=insert FQDN here" -DnsName "<insert FQDN here>","insert NetBIOS name here" -FriendlyName "Self Signed Certificate Friendly Name" -KeySpec KeyExchange -KeyLength 2048 -NotAfter (Get-Date).AddYears(5)
Please replace 'insert FQDN here' and 'insert NetBIOS name here' with the actual FQDN and NetBIOS name keeping the double quotes.
add a comment |
After 3 days I manged to Setup a connection locally with my SQL Server 2017.
Here what I did, I know its not a good approach but some how worked for me!
- Added Inbound New Rule for port 1433(Both TCP and UDP)
- Added outbound New Rule for port 1433(Both TCP and UDP)
- Allowed my client application in my case its Android Studio in the firewall.
- Tested with my Android app now no SSL required.

add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f205027%2funable-to-create-a-self-signed-certificate-for-sql-server-201714-x-xxxx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to enclose CertStoreLocation, Subject, DnsName and FriendlyName with double quotes.
There is no need to specify a location as it will default to "Local Computer/Personal/Certificates" where it needs to be in order to use it by SQL Server.
This will generate a valid certificate on Windows Server 2016 that will be usable by SQL Server 2017:
New-SelfSignedCertificate -Subject "CN=insert FQDN here" -DnsName "<insert FQDN here>","insert NetBIOS name here" -FriendlyName "Self Signed Certificate Friendly Name" -KeySpec KeyExchange -KeyLength 2048 -NotAfter (Get-Date).AddYears(5)
Please replace 'insert FQDN here' and 'insert NetBIOS name here' with the actual FQDN and NetBIOS name keeping the double quotes.
add a comment |
You need to enclose CertStoreLocation, Subject, DnsName and FriendlyName with double quotes.
There is no need to specify a location as it will default to "Local Computer/Personal/Certificates" where it needs to be in order to use it by SQL Server.
This will generate a valid certificate on Windows Server 2016 that will be usable by SQL Server 2017:
New-SelfSignedCertificate -Subject "CN=insert FQDN here" -DnsName "<insert FQDN here>","insert NetBIOS name here" -FriendlyName "Self Signed Certificate Friendly Name" -KeySpec KeyExchange -KeyLength 2048 -NotAfter (Get-Date).AddYears(5)
Please replace 'insert FQDN here' and 'insert NetBIOS name here' with the actual FQDN and NetBIOS name keeping the double quotes.
add a comment |
You need to enclose CertStoreLocation, Subject, DnsName and FriendlyName with double quotes.
There is no need to specify a location as it will default to "Local Computer/Personal/Certificates" where it needs to be in order to use it by SQL Server.
This will generate a valid certificate on Windows Server 2016 that will be usable by SQL Server 2017:
New-SelfSignedCertificate -Subject "CN=insert FQDN here" -DnsName "<insert FQDN here>","insert NetBIOS name here" -FriendlyName "Self Signed Certificate Friendly Name" -KeySpec KeyExchange -KeyLength 2048 -NotAfter (Get-Date).AddYears(5)
Please replace 'insert FQDN here' and 'insert NetBIOS name here' with the actual FQDN and NetBIOS name keeping the double quotes.
You need to enclose CertStoreLocation, Subject, DnsName and FriendlyName with double quotes.
There is no need to specify a location as it will default to "Local Computer/Personal/Certificates" where it needs to be in order to use it by SQL Server.
This will generate a valid certificate on Windows Server 2016 that will be usable by SQL Server 2017:
New-SelfSignedCertificate -Subject "CN=insert FQDN here" -DnsName "<insert FQDN here>","insert NetBIOS name here" -FriendlyName "Self Signed Certificate Friendly Name" -KeySpec KeyExchange -KeyLength 2048 -NotAfter (Get-Date).AddYears(5)
Please replace 'insert FQDN here' and 'insert NetBIOS name here' with the actual FQDN and NetBIOS name keeping the double quotes.
edited Apr 26 '18 at 18:30
answered Apr 26 '18 at 17:19
Thomas KronawitterThomas Kronawitter
1698
1698
add a comment |
add a comment |
After 3 days I manged to Setup a connection locally with my SQL Server 2017.
Here what I did, I know its not a good approach but some how worked for me!
- Added Inbound New Rule for port 1433(Both TCP and UDP)
- Added outbound New Rule for port 1433(Both TCP and UDP)
- Allowed my client application in my case its Android Studio in the firewall.
- Tested with my Android app now no SSL required.

add a comment |
After 3 days I manged to Setup a connection locally with my SQL Server 2017.
Here what I did, I know its not a good approach but some how worked for me!
- Added Inbound New Rule for port 1433(Both TCP and UDP)
- Added outbound New Rule for port 1433(Both TCP and UDP)
- Allowed my client application in my case its Android Studio in the firewall.
- Tested with my Android app now no SSL required.

add a comment |
After 3 days I manged to Setup a connection locally with my SQL Server 2017.
Here what I did, I know its not a good approach but some how worked for me!
- Added Inbound New Rule for port 1433(Both TCP and UDP)
- Added outbound New Rule for port 1433(Both TCP and UDP)
- Allowed my client application in my case its Android Studio in the firewall.
- Tested with my Android app now no SSL required.

After 3 days I manged to Setup a connection locally with my SQL Server 2017.
Here what I did, I know its not a good approach but some how worked for me!
- Added Inbound New Rule for port 1433(Both TCP and UDP)
- Added outbound New Rule for port 1433(Both TCP and UDP)
- Allowed my client application in my case its Android Studio in the firewall.
- Tested with my Android app now no SSL required.

edited Jan 4 at 15:14
Dan Atkinson
1155
1155
answered Apr 29 '18 at 22:28
Azhar KalamAzhar Kalam
112
112
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f205027%2funable-to-create-a-self-signed-certificate-for-sql-server-201714-x-xxxx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have spelling mistake in
host.domain.com?– SqlWorldWide
Apr 26 '18 at 11:46
well yes that was I typo but still the error is same.
– Azhar Kalam
Apr 26 '18 at 13:00
Can you try this commans?
New-SelfSignedCertificate -CertStoreLocation Cert:CurrentUserMy -DnsName host.domain.com -KeySpec KeyExchange -FriendlyName SQLCert– SqlWorldWide
Apr 26 '18 at 13:20
Tried still the same error!
– Azhar Kalam
Apr 26 '18 at 13:28
Try wrapping the cert store location in quotes:
New-SelfSignedCertificate -CertStoreLocation "Cert:LocalMachineMy" -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName SQLCert– Max Vernon
Apr 26 '18 at 14:53