ca-chain.js 6.2 KB
'use strict';

const Agent = require('https').Agent
;

// Obtains an HTTPS Agent that will accept the discovery.meethue.com TLS certificate
module.exports.getDiscoveryMeetHueHttpsAgent = () => {
  const discoveryAgent = new Agent();

  discoveryAgent.options.ca = '-----BEGIN CERTIFICATE-----\n' +
    'MIIGLTCCBRWgAwIBAgIQDRFjcdUbFwTU3xg1Bre3yzANBgkqhkiG9w0BAQsFADBN\n' +
    'MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E\n' +
    'aWdpQ2VydCBTSEEyIFNlY3VyZSBTZXJ2ZXIgQ0EwHhcNMTkwNjE0MDAwMDAwWhcN\n' +
    'MjAwNjEzMTIwMDAwWjByMQswCQYDVQQGEwJOTDESMBAGA1UEBxMJRWluZGhvdmVu\n' +
    'MSEwHwYDVQQKExhTaWduaWZ5IE5ldGhlcmxhbmRzIEIuVi4xDDAKBgNVBAsTA0h1\n' +
    'ZTEeMBwGA1UEAxMVZGlzY292ZXJ5Lm1lZXRodWUuY29tMIIBIjANBgkqhkiG9w0B\n' +
    'AQEFAAOCAQ8AMIIBCgKCAQEAxaH5IfwVRAH/2/y4SlGOXTiLjXXm8Zto8YJsMVmv\n' +
    '2rqzxA3niZZfJ6SNFJUqWQ+M1Lhcn+yhKp//nrPiG4jUh7m0CWAQ+EgzrNkiYa9U\n' +
    'vC/yGqm2pwxDuPoT90ZdTHgH7+One1bNMn+YNH1/S+sLLf4I1vDwblijynN43cE1\n' +
    '02/HbCkAQ0PajRwOqsq8nxWTE6UV5qOWmkvlQuUQAC0zPd9a3bMax0PtY9Ld9ikL\n' +
    '2qoM+YbVcL7WvaS4YWm92z4bSZK/CIQmZYiB1Xat5TYQg0YxM1Iqj3wYV7lTdWgD\n' +
    'rfqds5z6I2jGZr72neI7BwJU6j+fHyc8wPbsudjYrDpnBQIDAQABo4IC4jCCAt4w\n' +
    'HwYDVR0jBBgwFoAUD4BhHIIxYdUvKOeNRji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gkqhkiG9w0BAQsFAAOCAQEAXTejYipPw7rmH+IYqR4r\n' +
    'CmcaDTI3CUvr05QSCPsrD7/rkS/SDP2Z0ZRqHyfDUhYkxrrrBJMcDd28sLm//YJ+\n' +
    '+gbGfu+L24cXn3iXyBRliLvFCTRwZfA+347C97y2L0IFQV0S5YSHUr2u7PqG7Jcl\n' +
    'qF5rLPgOYcBNxkjuksqhZZfElVzwwtc/qTAsPAn4PKnJ/gtcb2Dj+41BgZ/lFGDP\n' +
    'Cv/SjNQxw6gNHG5UtEu9qJ0xFVjAC9E13yHezDjKpZs7aBgAD8sWTffp1jJAVkyU\n' +
    'mHpUGHe72H75CnlF6jGu2djDcLkXrWWqd/vw6vFx4oMgBwCHF8IWexUIbJQ5LUHZ\n' +
    'iQ==\n' +
    '-----END CERTIFICATE-----\n' +
    '\n' +
    '-----BEGIN CERTIFICATE-----\n' +
    'MIIElDCCA3ygAwIBAgIQAf2j627KdciIQ4tyS8+8kTANBgkqhkiG9w0BAQsFADBh\n' +
    'MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n' +
    'd3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n' +
    'QTAeFw0xMzAzMDgxMjAwMDBaFw0yMzAzMDgxMjAwMDBaME0xCzAJBgNVBAYTAlVT\n' +
    'MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxJzAlBgNVBAMTHkRpZ2lDZXJ0IFNIQTIg\n' +
    'U2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n' +
    'ANyuWJBNwcQwFZA1W248ghX1LFy949v/cUP6ZCWA1O4Yok3wZtAKc24RmDYXZK83\n' +
    'nf36QYSvx6+M/hpzTc8zl5CilodTgyu5pnVILR1WN3vaMTIa16yrBvSqXUu3R0bd\n' +
    'KpPDkC55gIDvEwRqFDu1m5K+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it\n' +
    'c+LJMto4JQtV05od8GiG7S5BNO98pVAdvzr508EIDObtHopYJeS4d60tbvVS3bR0\n' +
    'j6tJLp07kzQoH3jOlOrHvdPJbRzeXDLz\n' +
    '-----END CERTIFICATE-----\n' +
    '\n' +
    '-----BEGIN CERTIFICATE-----\n' +
    'MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n' +
    'MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n' +
    'd3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n' +
    'QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n' +
    'MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n' +
    'b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n' +
    '9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n' +
    'CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n' +
    'nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n' +
    '43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n' +
    'T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n' +
    'gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n' +
    'BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n' +
    'TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n' +
    'DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n' +
    'hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n' +
    '06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n' +
    'PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n' +
    'YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n' +
    'CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n' +
    '-----END CERTIFICATE-----\n';

  return discoveryAgent;
};