J'essaye de configurer la compétence alexa demo hello world sur mon propre serveur (A framboise pi). J'ai essayé ceci sur un mac et cela fonctionne.Mise en place d'un serveur alexa hello world demo
Je suivais les instructions suivantes: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/deploying-a-sample-skill-as-a-web-service
Nous utilisons les compétences alexa-kit-1.4.0.jar, et un certificat https non auto-signé.
Le serveur s'exécute, et nous pouvons le tester en utilisant curl, à partir d'un serveur externe. Toutefois, si je test sur le site Web de alexa le serveur donne l'erreur:
Error "Caused by: java.io.IOException: Connection reset by peer" with hello world java example (external server)
Ceci est la demande que nous envoyons avec boucle qui fonctionne:
curl -v https://samneaves.ddns.net:443/hello --data-binary '{
> "session": {
> "sessionId": "SessionId.1f8a866f-1c47-439e-9e80-9811319a6b69",
> "application": {
> "applicationId": "amzn1.ask.skill.bda1b928-bb31-4751-92a1-51594baa0545"
> },
> "attributes": {},
> "user": {
>
"userId":
"amzn1.ask.account.AFSSQO63BZIPWAZGAPT4MST2DM5GHYQA3BGVVEUJJ6XS2C4V4H5V33J446YEQIE4FKHHEBT6UL3SAIRGNJWWHSOCEO4VY6EI3CL3ZQTCLCFZCEEXGMOIMYUYZNBHST5WY2MNMLEAMD2TJRVKTPGUEMJ4GOSZRTZWEUJRAH7FVOVB7TI6VM4MFATTBEZGY5NUWRBUKEWIHCE5H7I"
> },
> "new": true
> },
> "request": {
> "type": "IntentRequest",
> "requestId": "EdwRequestId.0063cee4-affc-4ea8-8be0-0ff9106fe93b",
> "locale": "en-GB",
> "timestamp": "2017-08-04T18:16:46Z",
> "intent": {
> "name": "HelloWorldIntent",
> "slots": {}
> }
> },
> "version": "1.0"
> }'
* Trying 82.38.154.2...
* Connected to samneaves.ddns.net (82.38.154.2) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
* Server certificate: samneaves.ddns.net
* Server certificate: Let's Encrypt Authority X3
* Server certificate: DST Root CA X3
> POST /hello HTTP/1.1
> Host: samneaves.ddns.net
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 818
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 818 out of 818 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 181
< Server: Jetty(9.0.6.v20130930)
<
* Connection #0 to host samneaves.ddns.net left intact
{"version":"1.0","response":{"outputSpeech":{"type":"PlainText","text":"Hello
world"},"card":{"type":"Simple","title":"HelloWorld","content":"Hello
world"},"shouldEndSession":true}}
Cependant, lors de l'envoi d'une demande de la alexa test nous obtenons l'erreur "L'extrémité distante n'a pas pu être appelée, ou la réponse qu'elle renvoyait n'était pas valide."
Et la sortie du journal sur le serveur est:
1455213 [[email protected]{SSL-HTTP/1.1}{0.0.0.0:443}] DEBUG org.eclipse.jetty.io.SelectorManager - Queued change [email protected]11
1455219 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Selector loop woken up from select, 0/0 selected
1455224 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Running change [email protected]11
1455263 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.AbstractEndPoint - onOpen [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{null}{io=0,kio=0,kro=0}
1455302 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.IdleTimeout - [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{null}{io=0,kio=0,kro=0} idle timeout check, elapsed: 37 ms, remaining: 29963 ms
1456864 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.IdleTimeout - [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{null}->[email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{null}{io=0,kio=0,kro=0} idle timeout check, elapsed: 1 ms, remaining: 29999 ms
1456889 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.server.HttpConnection - New HTTP Connection [email protected]{IDLE},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}
1457229 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.AbstractConnection - onOpen [email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{IDLE},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}
1457257 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.AbstractConnection - onOpen [email protected]{IDLE},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}
1457281 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.AbstractConnection - fillInterested [email protected]{IDLE},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}
1457313 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.AbstractConnection - fillInterested [email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{INTERESTED},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}
1457385 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectChannelEndPoint - Local interests updated 0 -> 1 for [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{true,[email protected]},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{INTERESTED},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=1,kio=0,kro=0}
1457455 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Created [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{true,[email protected]},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{INTERESTED},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=1,kio=0,kro=0}
1457460 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Running change [email protected]
1457465 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectChannelEndPoint - Key interests updated 0 -> 1
1457469 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Selector loop waiting on select
1457474 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Selector loop woken up from select, 1/1 selected
1457478 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectChannelEndPoint - Key interests updated 1 -> 0
1457548 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectChannelEndPoint - Local interests updated 1 -> 0 for [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{true,[email protected]},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{INTERESTED},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=0,kro=1}
1457553 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Running change [email protected]
1457620 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.ssl.SslConnection - onFillable enter [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{INTERESTED},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=0,kro=1}
1457639 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.util.thread.QueuedThreadPool - qtp17573111{STARTED,8<=8<=200,i=6,q=0} dispatched [email protected]
1457683 [qtp17573111-13] DEBUG org.eclipse.jetty.server.HttpConnection - [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} onFillable [email protected]@IDLE,initial
1457741 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} fill enter
1457772 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.ssl.SslConnection - onFillable exit [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=-1/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=0,kro=1}
1457788 [qtp17573111-11-selector-0] DEBUG org.eclipse.jetty.io.SelectorManager - Selector loop waiting on select
1457833 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ChannelEndPoint - filled 223 [email protected]3{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=18209/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=0,kro=1}
1457865 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_UNWRAP,eio=223/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} filled 223 encrypted bytes
1457898 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_TASK,eio=0/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} unwrap Status = OK HandshakeStatus = NEED_TASK
bytesConsumed = 223 bytesProduced = 0
1458193 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ChannelEndPoint - filled 0 [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_WRAP,eio=18432/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=0,kro=1}
1458226 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_WRAP,eio=0/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} filled 0 encrypted bytes
1458259 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_WRAP,eio=0/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} unwrap Status = OK HandshakeStatus = NEED_WRAP
bytesConsumed = 0 bytesProduced = 0
1458293 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_WRAP,eio=0/-1,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} flush enter [java.nio.HeapByteBuffer[pos=0 lim=0 cap=0]]
1458325 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_UNWRAP,eio=0/15864,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} wrap Status = OK HandshakeStatus = NEED_UNWRAP
bytesConsumed = 0 bytesProduced = 2568
1458442 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}->[email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=true,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=0/2568,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=0,kro=1} OK [email protected][p=0,l=2568,c=18432,r=2568]={<<<���|����M��Y��>��...��D����4[�B����>>>™©��...™©}
1458508 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ChannelEndPoint - close [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=false,is=false,os=false,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=0/2568,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=0,kro=1}
1458573 [qtp17573111-13] DEBUG org.eclipse.jetty.io.SelectorManager - Destroyed [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=false,is=true,os=true,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=0/2568,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=-1,kro=-1}
1458595 [qtp17573111-13] DEBUG org.eclipse.jetty.io.AbstractConnection - onClose [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}
1458627 [qtp17573111-13] DEBUG org.eclipse.jetty.io.AbstractConnection - onClose [email protected]{NEED_UNWRAP,eio=0/2568,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}
1458692 [qtp17573111-13] DEBUG org.eclipse.jetty.io.AbstractEndPoint - onClose [email protected]{/72.21.217.99:21194<r-l>/192.168.0.5:443,o=false,is=true,os=true,[email protected]{false,null},[email protected]{IDLE},it=30000}{[email protected]{NEED_UNWRAP,eio=0/2568,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0}}{io=0,kio=-1,kro=-1}
1458724 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_UNWRAP,eio=0/2568,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} flush exit, consumed 0
1458763 [qtp17573111-13] DEBUG org.eclipse.jetty.io.ssl.SslConnection - [email protected]{NEED_UNWRAP,eio=-1/2568,di=-1} -> [email protected]{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=START,0 of 0} fill exit
1458766 [qtp17573111-13] DEBUG org.eclipse.jetty.server.HttpConnection -
org.eclipse.jetty.io.EofException
at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:186)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:797)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:610)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:240)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:492)
at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:165)
... 7 more
Je peux l'obtenir pour travailler sur un mac avec le certificat que j'ai. – user27815