Skip to content

Instantly share code, notes, and snippets.

@MidLevel-Bot MidLevel-Bot/quickstart.md Secret

Created May 23, 2020
Embed
What would you like to do?
http://cert.midlevel.io/ Generated on 23/05/2020 01:43:48 by ::ffff:35.172.146.236

ONLY USE SELF SIGNED CERTIFICATES INTERNALLY OR FOR TESTING. USE A SERVICE LIKE LETSENCRYPT FOR REAL CERTIFICATES. THIS PROGRAM WILL GENERATE A CERTIFICATE AUTHORITY KEY PAIR AND A CERTIFICATE SIGNED BY THAT AUTHORITY. CERTIFICATES ARE ONLY VALID FOR 30 DAYS. AFTER THAT TIME YOU NEED A NEW ISSUER AND CERTIFICATE.

Quickstart Instructions (Basic Usage)

Server Instructions

ONLY DO THIS STEP ON THE SERVER. IT SHOULD NOT BE DONE ON CLIENTS. THIS STRING CONTAINS A BASE64 ENCODED PFX FILE, WHICH IS A COMBINATION OF THE CERTIFICATE AND THE PRIVATE KEY FOR THE CERTIFICATE WHICH IS USED TO SIGN KEY EXCHANGES.

In the NetworkingManager.NetworkConfig ServerBase64PfxCertificate text field. Enter the following:

MIIJaQIBAzCCCS8GCSqGSIb3DQEHAaCCCSAEggkcMIIJGDCCA88GCSqGSIb3DQEHBqCCA8AwggO8AgEAMIIDtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQICyYLyP/lJ0oCAggAgIIDiAVB177X0l9uv8aRQ/Hr6gvoFwwKFCObKblkobNZOPWI97HB0WANhoBg2cIH49SkWqyo5zY1uB1+z/HYKpwRCiX0MV5/pqo0uJPiU/Q7MkKvyNs0jij0KbYOqLv3ld+zyI/ueS0W7vcpNEke9zhR+aqViYIhGQ+g5C67vXkGGzzXM3zLxK1Tg7YxDqUShDfqC7SsL3AtFGDJ7fK/OC2TO4Luu7gePAu5a4Enx6u92lkHeDcsZuDs1FajS4RQrV356DiCz/ixVn8BC6hwMHWcIJ55GX6MshTBX7P0zA4R1QKO2yohdrRgl6EY/7mi6bXoJ4OzQY2apT76Ouu8Smqj12b1UKBkqVmU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P/EX0mhk6GMcf66VhjjtlA9r8jfJ03bE/bgqei5JWVCUM+eef8FfUf+FEm5XSI5AtHQ8Uyx6t7Eko5qwirrqxUBlCTqhGMQogfo+FfwmAmbITju+HeyPJr1PQ8X7wXIbNcG3aCg5/D7wgGVrjJLKnsbAFBfcGAf4H5g/I9PY50cnIblYC4LFomsAQFd7Yz0bcH2Wuehl/d5QAIu1Y9REsESnl1aQdRTnuDCfEXJyfsQEjhO8uZrCz4uDAXGHAUKV27+PJijNRzM8K8VxArcm6yxH+wNZEYEzphlyi9tJonk7dvAlWy8aFQArQCCdjHxhroDjqqk8YZEKGkWWwcLpmFvMlTyNJKVueNP8ZyAsmwgTiLeLmjbZTMCNcsLQTSRvgQrCoIfe58NWHfn3N97HbWHhkqPG0aHHODgWIp0Sku/n1EwUjMqqbZi/r1GwpN3ZxDElMCMGCSqGSIb3DQEJFTEWBBR5qFmFStQ66Gc4JN2GEB35A6c4CTAxMCEwCQYFKw4DAhoFAAQU+SIR9dznrK3iQcvWw4XPbejkbXQECFyhuZUAIE5tAgIIAA==

Client instructions

To make clients trust your certificate issuer. Please do the following before connecting:

CryptographyHelper.OnValidateCertificateCallback = (certificate, hostname) =>
{
  X509Certificate2 issuerCertificate = new X509Certificate2(Convert.FromBase64String("MIIC5jCCAc6gAwIBAgIIEUyMGbV8gwswDQYJKoZIhvcNAQELBQAwGTEXMBUGA1UEAxMOVW5uYW1lZCBJc3N1ZXIwHhcNMjAwNTIzMDE0MzQ4WhcNMjAwNjIyMDE0MzQ4WjAZMRcwFQYDVQQDEw5Vbm5hbWVkIElzc3VlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANQCh5NULjhZel2EMzqYxiyygLtAtyy1EFGk+vWGUCjWzr79trPRhlKkX1USa5F0jQPkj6vedeExQnozbL6pBULMIgi/CESe8k3UlM1jt/g1c4/HbumOZ5W3K0XTuLAOXTq7XDa6AVz2tJiYeSJX+A1/Awzx3JH4aiySpQV+1Wp/AwGwLsdqRfPDnYRqm2ldU/mR81RsZHDr23mlZxnVLbudOSsRekkC9kFJo5egsnqXqhVT7LjQ5YGno5F+6Zwg7PX1o6eGD7ut3R7tqshFSTdfoZys3HEPxjT2R92XRh3vKdBsOv5/q9fYvSrrS9rdII/rXzk761WlJ02sXVqFCs8CAwEAAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUuhjkVgsRQ5hzqPEU4sRiWXdPagkwDQYJKoZIhvcNAQELBQADggEBALswm87rcaexHu44qMCPTYuID5K7MPZrlHjzmAcW+yZ7zo7BARW8koAsfAAwdoz2VvoLROmb8fO7UuvKznJQVqJ+p4i3bSsK1CVdycqHuic9mV9ppLRxjuYSuyjPDXx5SZJAYhlVRolpNyFBF3jdrysGQ1v2SpnnR/YIvIKWZt+mNyvRwcSED1kptF9LJf6BgbLrJikIFX9a51uPQPH2BHx2z6jVNKjr2qVNSAHLKb7B0lzGfKsUEoGf5exb6YCR3F4gNGrv019IN41xfd3O6/CkzxAQE0xIfUFSUV+zxNNJ/UHv3+g870DRn+0thZxMIapHvZEzh8Dflu795UbqrH0="));
  X509Chain verify = new X509Chain();
  verify.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
  verify.ChainPolicy.ExtraStore.Add(issuerCertificate);
  verify.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority;

  // Check if the chain accepts it. This can mean that it's from a CA we trust OR our own CA.
  bool isAcceptedByChain = verify.Build(new X509Certificate2(certificate));

  if (isAcceptedByChain)
  {
    // Validate with the last added CA, that's our CA
    return verify.ChainElements[verify.ChainElements.Count - 1].Certificate.Thumbprint == issuerCertificate.Thumbprint;
  }

  return false;
}

Details (Advanced Users Only)

Property Value
Issuer Name CN=Unnamed Issuer
Issuer Key Type RSA
Issuer Key Size 2048
Issuer Validity Start 23/05/2020 02:43:48 (UTC)
Issuer Validity End 22/06/2020 02:43:48 (UTC)
Issuer Serial Number 114C8C19B57C830B
Issuer Thumbprint 04650A70413994042899EEAF3D53358347AF0CA1
Certificate Name CN=Unnamed MLAPI Development Certificate
Certificate Serial Number 556E8534DDCF6479353E3951F8FADB9B
Certificate Thumbprint 79A859854AD43AE8673824DD86101DF903A73809
Certificate Key Type RSA
Certificate Key Size 2048
Certificate Validity Start 23/05/2020 02:43:48 (UTC)
Certificate Validity End 22/06/2020 02:43:48 (UTC)

Keys

These are the keys that were used

Issuer Public/Private Key

<?xml version="1.0" encoding="utf-16"?>
<RSAParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <D>p77wooOCppc1mHSXTA/BDXCXJpHH3RnONatB3a5OEmIT5047lv97NjxUKa2PauE7Cg94FdbIkks1fBbgPeLiBL4bV6w+0Hyq3yYKLpBt6XfxXZvAiA9iqjTpijBA+xwCbAv+pFZ76aBRuEM75Q6Rd6w9L6rWiLBy4Z2N8FEwbzdpWWQIDCW2U/itjPy74+qOT4wzFHZFcmkmfdy86itDKQfVE+jXODF/TuJCrHU3PegGVdQ3fjI69TY6Jz+GRGCsaK5s7LbilOfnDUWbvIqyUIk1xvU3Wo2aMB94gAu+Ig82mfXArzCfuDDF4mRamZ3HfcGXtUKQ5gC7FCkw0D+oEQ==</D>
  <DP>i9ZQ+kP+1JEbTM8qagJVhuaTyOvWsKoIppsrINHPaR0SoubCyVnoS4yAuOlQik+AncaLVM7gXXVHW6R3XnAYLjc5MUe50+zzPyJbU2SnCud6JdFFOAVzOf4yShXgO2ERHSLxdkq+R2KjO9zhUHYaMbZMVDI7K0rPEz0U0FXO1VM=</DP>
  <DQ>uD+YHRUthwdzPIBQ9ETcT98Xwvh0pUWmqsXJguTT/kPBCeK6FTKj/+JQN0R5Hk2TZN1Dl73AidrLFK1qIFZBYpUYxpXCrR0pBwXLK4jakO7FTmHzi6o9ReanYIQFLzlqbfQM9yxIavf5WQKfdC6H4/pDRvUtwF9y768L6G+VzRk=</DQ>
  <Exponent>AQAB</Exponent>
  <InverseQ>thK5XwQQcs2kXMZg4mKMkdN7wRPyTqe9IBTjxxl3eSaMyfI1+EQ4UGHpTZys/jMV5EBsUrtHYM01AuzOvx4W64dN0ZUvaFj9GbJS3cmzYvSWhb7qCbfQvBrMqJa5uFU4TJjoXn/3qA8DjqwoKjaNChjOGuDaCdKXpGYweQ7mTew=</InverseQ>
  <Modulus>1AKHk1QuOFl6XYQzOpjGLLKAu0C3LLUQUaT69YZQKNbOvv22s9GGUqRfVRJrkXSNA+SPq9514TFCejNsvqkFQswiCL8IRJ7yTdSUzWO3+DVzj8du6Y5nlbcrRdO4sA5dOrtcNroBXPa0mJh5Ilf4DX8DDPHckfhqLJKlBX7Van8DAbAux2pF88OdhGqbaV1T+ZHzVGxkcOvbeaVnGdUtu505KxF6SQL2QUmjl6CyepeqFVPsuNDlgaejkX7pnCDs9fWjp4YPu63dHu2qyEVJN1+hnKzccQ/GNPZH3ZdGHe8p0Gw6/n+r19i9KutL2t0gj+tfOTvrVaUnTaxdWoUKzw==</Modulus>
  <P>/6ularL/RLYd0uU0kLpe5UTNbMZl6v5qsI9OgqjvaoKQ0o1SJ1P6hoP4IB/Vob31bMWNQRXTpsRdON6P1/HSGCZGsZiYAT+MrIBtoDLssUAbEAeBoHmp0oQ59yGIho/a2XhWZZKw1VkkWTeJT9WumILEjCuPkcW5nDNkqQ1ikqs=</P>
  <Q>1Eh6eMzpnX8YucxpjKZzZbNc8g7sDWdpyq35bqkyjhcOwpo+FtR8ML4IDdjGZYInhpikfY2iJyI8QDvn5yihMf6FW9TfWRVC3rMdEgwbXxEH+J2iwYgOQiPCEZp5sPttBwFIRClwbeMXBSztMPvea1IYeG/HWqfG9xa+cVblyG0=</Q>
</RSAParameters>

Certificate Public/Private Key

<?xml version="1.0" encoding="utf-16"?>
<RSAParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <D>4dZ+bhOVSqRNGufOPTB2jYe4aoM8DTDZnzB0UA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9cLU9lJkjyj4zjXwDetCy7x0gZZKhZY8uL8ebZa8GlpjtUDhDAG67+Eft9aokWD48LPcZMS4Cf1Kn/xbu33q+OOeLS+VLJv4QUyJ+jG36DJQbcFF9d4Wq6/rz1iz/ZEQGCkChTkhYd8bMw3Zw==</Modulus>
  <P>+mrff75sSL9B2O41wnKH7jwsCm4iKySxDgrzlJx0FavvecqmN9M15cLe4HVyGboATAYN7mkFaoPWGlMY/4RG2z47DOKL+amC7XTPnz5tfnB2FXrqVu6Y/Px9kEa5JLOh+BOfnmyp5hWiuICEBwcHZM1uWZwIYAt57Dw3G08Va1E=</P>
  <Q>7Mppq4T4uWSczUtwAt2J386fF4FUhKtjgnB9JIaasrVWUlsfhTlvAzPaAlhBxVJfJrxdsNZKInQzq2rARcMRt8HYBQRGy7P4n4HujLSGQx4RhCZaPOfw7ZD5GQuGhkWAjw9xGZw8aLBpIhGSCxWmRusPqKvlRNgTe5lMU2/zWTc=</Q>
</RSAParameters>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.