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












2















Using SQL Server 2017 Developer Edition



SelfSigned Cert Error



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









share|improve this question
















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 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
















2















Using SQL Server 2017 Developer Edition



SelfSigned Cert Error



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









share|improve this question
















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 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














2












2








2








Using SQL Server 2017 Developer Edition



SelfSigned Cert Error



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









share|improve this question
















Using SQL Server 2017 Developer Edition



SelfSigned Cert Error



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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



















  • 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

















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










2 Answers
2






active

oldest

votes


















0














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.






share|improve this answer

































    0














    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!




    1. Added Inbound New Rule for port 1433(Both TCP and UDP)

    2. Added outbound New Rule for port 1433(Both TCP and UDP)

    3. Allowed my client application in my case its Android Studio in the firewall.

    4. Tested with my Android app now no SSL required.


    Screenshot of Windows showing a successful test connection






    share|improve this answer

























      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
      });


      }
      });














      draft saved

      draft discarded


















      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









      0














      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.






      share|improve this answer






























        0














        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.






        share|improve this answer




























          0












          0








          0







          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.






          share|improve this answer















          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.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 26 '18 at 18:30

























          answered Apr 26 '18 at 17:19









          Thomas KronawitterThomas Kronawitter

          1698




          1698

























              0














              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!




              1. Added Inbound New Rule for port 1433(Both TCP and UDP)

              2. Added outbound New Rule for port 1433(Both TCP and UDP)

              3. Allowed my client application in my case its Android Studio in the firewall.

              4. Tested with my Android app now no SSL required.


              Screenshot of Windows showing a successful test connection






              share|improve this answer






























                0














                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!




                1. Added Inbound New Rule for port 1433(Both TCP and UDP)

                2. Added outbound New Rule for port 1433(Both TCP and UDP)

                3. Allowed my client application in my case its Android Studio in the firewall.

                4. Tested with my Android app now no SSL required.


                Screenshot of Windows showing a successful test connection






                share|improve this answer




























                  0












                  0








                  0







                  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!




                  1. Added Inbound New Rule for port 1433(Both TCP and UDP)

                  2. Added outbound New Rule for port 1433(Both TCP and UDP)

                  3. Allowed my client application in my case its Android Studio in the firewall.

                  4. Tested with my Android app now no SSL required.


                  Screenshot of Windows showing a successful test connection






                  share|improve this answer















                  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!




                  1. Added Inbound New Rule for port 1433(Both TCP and UDP)

                  2. Added outbound New Rule for port 1433(Both TCP and UDP)

                  3. Allowed my client application in my case its Android Studio in the firewall.

                  4. Tested with my Android app now no SSL required.


                  Screenshot of Windows showing a successful test connection







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 4 at 15:14









                  Dan Atkinson

                  1155




                  1155










                  answered Apr 29 '18 at 22:28









                  Azhar KalamAzhar Kalam

                  112




                  112






























                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Ronny Ackermann

                      Köttigit

                      MySQL 8.0.15 starts normally but any connection hangs