botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

ERROR: Error retrieving OpenId metadata at https://api.aps.skype.com/v1/.well-known/openidconfiguration

Open ebrulato opened this issue 10 years ago • 4 comments

Hi,

I have a strange issue :

When I test the connection to my Bot, the interface raised an "InternalServerError". On my server's log I found :

ERROR: Error retrieving OpenId metadata at https://api.aps.skype.com/v1/.well-known/openidconfiguration, error: Error: Hostname/IP doesn't match certificate's altnames: "Host: api.aps.skype.com. is not in the cert's altnames: DNS:*.aps.skype.com" ERROR: ChatConnector: receive - invalid signing key or OpenId metadata document.

This error is raised by OpenIdMetadata.js when the method 'getKey' is called.

Configuration (RP3) :

  • nodejs v6.9.1
  • node red v0.15.2
  • Linux 4.4.16-6-osmc arm LE

My RP3 is on my local Lan (NAT), I use a Let's Encrypt certificate (works fine on other platform)

Very similar to this note.

Regards,

ebrulato avatar Nov 15 '16 08:11 ebrulato

Hi @ebrulato, I'm not sure what to make of this -- the snippet you provided shows that the Subject Alternative Name field contains the expected value ("*.aps.skype.com"). The only thing I can think of is that your SSL lib does not like wildcards in SANs. Is there another cert with a wildcard in the SAN that is working without problems?

dandriscoll avatar Nov 15 '16 22:11 dandriscoll

Thanks, I will check the version of my SSL lib, but I've done a complete upgrade of my RP3... and I will try to find other sample to be sure there is no issue with the BotBuilder :) Regards,

ebrulato avatar Nov 16 '16 13:11 ebrulato

Hi @dandriscoll

I still investigate this issue. If I use this code

var r = require('request');

var options = { method: 'GET', url: 'https://api.aps.skype.com/v1/.well-known/openidconfiguration', json: true };

r(options, function(err, response, body) { console.log('code='+response.statusCode); console.log(body); console.log('err='+err);

options.url = body.jwks_uri;

r(options,
  function(err, response, body) { 
    console.log('code='+response.statusCode);
    console.log(body);
    console.log('err='+err); 
});

} )

This code is very similar to the code of OpenIdMetadata.js The result is :

code=200 { issuer: 'https://api.botframework.com', authorization_endpoint: 'https://invalid.botframework.com', jwks_uri: 'https://api.aps.skype.com/v1/keys', id_token_signing_alg_values_supported: [ 'RSA256' ], token_endpoint_auth_methods_supported: [ 'private_key_jwt' ] } err=null code=200 { keys: [ { kty: 'RSA', use: 'sig', kid: 'e9d2Ej_yEdf2jCBDDJKVqsW-cXo', x5t: 'e9d2Ej_yEdf2jCBDDJKVqsW-cXo', n: '1X8Pa5XWh6Ol3bLBQ5b6LN5KXe_R2W1w5IXbsNCRvabQf3Y9hgtR6ZUlSXotwrdmUzTkjpGys8rkZRp0C0FF19bMSrY8I1A6FJZXlwkeJ6VZDn76oW1eLBo4a-ec70UvhXm4sQnW3b2BWL0WLTWZng2MacDvNdq36CqmmNAPxuPs32JbtobWKivxzr5Jj_WTG6kxPJ30H-kRC1bUj7TrT464yiMDFljv-14AdDR2crEGGek9ZByW-zZaDxLwK8vyLvswn5B28S1infty1oqYUxP-NMNd9jXVIZoYhjjlhGAUs0vF5gMfFr4qUL7opOWF_hbwe9dCaTc6vN5yazMQGQ', e: 'AQAB', x5c: [Object] }, { kty: 'RSA', use: 'sig', kid: 'oI2pysRK0KWZ9Jd0meQFJRHkyAE', x5t: 'oI2pysRK0KWZ9Jd0meQFJRHkyAE', n: 'ne1IUhdxcczsCYTOU3garyO2ltVnJRhl5fATBV1OGhEgEM4IneKZcpqzixnlLt-AJRqEwQH8u7sFPJWo1IlEpXK5auSLhNX3qbq7Fgzw-joWoTJwc5Gc46F03fi0pOnRzIkOrB2BXe6OyAVoQpd8sm8K7CPqD9Qkoc03i8dwG33tabHm0YS9Nw6aODPcl5F9A_YGo2KGo0-piOjX0kjoGgGnM6nbIDk5fVaXeboGHhFUwwyNd_Q8iRXmtxTAp7IZdk26beH4Zlc7NFHDqzQQKfKpGikcJKlwm0RR4y_IPaIsqQHlWZG8NMXknovaDgCZ6HuiiCq8gA22sT8pFHI5Cw', e: 'AQAB', x5c: [Object] }, { kty: 'RSA', use: 'sig', kid: 'b4ysOWItD13iQfLLeBFX9lRPDtk', x5t: 'b4ysOWItD13iQfLLeBFX9lRPDtk', n: 'yk4rv691yrqBWP5BsTfhLak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EpHOn1ImrBkwpmwElryvAU8Q5G_O_pDoSZ2eIN5jIZO5Eeo0ybwJSfcS6SjDE0FcWNGOJhTmK1PvtLHNWGPiRR3i1YNeCpiH0524_5r3FRS0RO2gn51j8lSreNpDk9xuG0ohLmI7z_dboHr_J3QVe3Zw', e: 'AQAB', x5c: [Object] }, { kty: 'RSA', use: 'sig', kid: 'yceHp93RzmN-kd8vCnKEulqI8Zo', x5t: 'yceHp93RzmN-kd8vCnKEulqI8Zo', n: 'uWfitwq1Pr_shNl3_qmR9c4ue6TM_uc-alWs6aY1Hif7HGMdQQGLWbh-o4WDO2bXhFJPXxB0eRm-GXrHqfBB1Ne5iWiTldOFYTbLXSEiILrbAi9A2rHdAuxuWIeQDDHPOb6tII_jvHNXA24q5paXktaSV0arn4fRpOMmi_eW4QQqPK0LeTNfd4LhGpKX26o8Fc3hu9RSUUbVXo1qMYyP3U75PBWSqYVGIXnFRu9FbLP8AmSCzZB0RI5kQEZQ-zs70cCnyBp1bGZI6J_qDwFlyQmH7Y-0kCfxONAItLe7vRNnCn1104EpObqg22oFKeYuwXD2jlZILfBifl_ETQPyvw', e: 'AQAB', x5c: [Object] } ] } err=null

I test the call of https://api.aps.skype.com/v1/.well-known/openidconfiguration with curl and have not the issue. I add some trace in OpenIdMetadata.js and the first call returns this error :

{ Error: Hostname/IP doesn't match certificate's altnames: "Host: api.aps.skype.com. is not in the cert's altnames: DNS:_.aps.skype.com" at Object.checkServerIdentity (tls.js:199:17) at TLSSocket. (_tls_wrap.js:1068:29) at emitNone (events.js:86:13) at TLSSocket.emit (events.js:185:7) at TLSSocket._finishInit (_tls_wrap.js:586:8) at TLSWrap.ssl.onhandshakedone (tls_wrap.js:416:38) reason: 'Host: api.aps.skype.com. is not in the cert's altnames: DNS:.aps.skype.com', host: 'api.aps.skype.com', cert: { subject: { CN: '.aps.skype.com' }, issuer: { C: 'US', ST: 'Washington', L: 'Redmond', O: 'Microsoft Corporation', OU: 'Microsoft IT', CN: 'Microsoft IT SSL SHA2' }, subjectaltname: 'DNS:.aps.skype.com', infoAccess: { 'CA Issuers - URI': [Object], 'OCSP - URI': [Object] }, modulus: 'ABD68F13F588F28CC4BF56780ECBD728F27BAC26699FB2741D4D31D4AB6BA411999C57E450BFA5C02FAB64F60F8AE3E972BA14FC2824D22BD6716DBEA68466E377FADEB62BA23D8204B02AA1811F4FDDD80F53E68A88F5C045425CB48FA478FFBB6FF29E2E1B32E675D5894DD4E3ABA5A0FDBA569BC0CFCEE929407D004ED8C53F7A64DACEBCCA84656CDF84C1EE27CD6A94CB13A7D3716C8BE41C63C0CC23F14FFCD27F736748D42EF90181CD9845A35FB26202FE551BC16CB2A43FA238AED66B543224C7BF869FFF3098F8D08ECE385FC0214EE1B5D7A78A914F5476B5435849D59338FD5A4F134F72EB6E1AAEC8AA6B754676E589BB3069B38EE2D65685BB', exponent: '0x10001', valid_from: 'Sep 20 18:18:53 2016 GMT', valid_to: 'Apr 20 18:18:53 2018 GMT', fingerprint: '91:8B:C0:A2:86:2C:27:EB:D0:4F:A7:86:95:70:A6:2B:26:68:DA:48', ext_key_usage: [ '1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2' ], serialNumber: '5A00047DD98F94EB07B45B506C000100047DD9', raw: <Buffer 30 82 06 e4 30 82 04 cc a0 03 02 01 02 02 13 5a 00 04 7d d9 8f 94 eb 07 b4 5b 50 6c 00 01 00 04 7d d9 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 ... > } }

Have you any other suggestion... idea ? The nodeJS version is the same, the request lib used have the same version... openssl version is "OpenSSL 1.0.1t 3 May 2016" Where is the difference ??? Why the MS Bot Framework has a different behavior ?

Regards,

ebrulato avatar Nov 18 '16 23:11 ebrulato

Hi, I have made more investigation. I found other cases with the same issue (api.ai, ...) In fact I create a simple node for node-red

here is the code

var r = require("request"); // -------------------------------------------------------------------------- // NODE-RED // -------------------------------------------------------------------------- module.exports = function(RED) { const register = function(config) { RED.nodes.createNode(this, config);

    this.on('input', (data)  => { input(this, data, config, RED)  });
}
RED.nodes.registerType("test", register, {});

};

const input = (node, data, config, RED) => {

var options = { method: 'GET', url: 'https://api.aps.skype.com/v1/.well-known/openidconfiguration', json: true };

r(options, function(err, response, body) { console.log('err='+err); console.log('response='+response); console.log('body='+body); }); node.send(data); };

and the result in node-red 0.15.2 with my RPi3 is

err=Error: Hostname/IP doesn't match certificate's altnames: "Host: api.aps.skype.com. is not in the cert's altnames: DNS:*.aps.skype.com" response=undefined body=undefined

:(

It seems that node-red override ssl I close this issue

Regards,

ebrulato avatar Nov 20 '16 16:11 ebrulato