Alexa skills kit integration with locally hosted service gives error - ssl-certificate

I am trying to integrate Alexa with my locally hosted service. I am trying to hit my URL
https://www.myurl.com:443/somepath
I am generating a self signed certificate for the domain "myurl.com."
However, when I test it in the service simulator I get the response
"The remote endpoint could not be called, or the response it returned was invalid."
The error is "Parse error on line 1: The remote endpoint".
Could someone tell me how exactly I could integrate Alexa with the URL stated above?

Related

Is HTTPS required for any Sonos service in a developer sandbox?

I have the Sonos Acme developer test service setup and running but my Sonos Player doesn't seem to be able to connect. I'm wondering if a TLS SSL certificate is required no matter what even in a sandboxed environment.
I'm running the java service on a remote AWS instance behind a domain. The service is setup with the default installation details. It does not log any sort of connection attempt once I add the service to the Sonos player via customSD.
Accessing the Sonos Player via customSD and adding the Acme service does respond with Success! But again it doesn't show up in the service list. Manually pulling the WSDL does work correctly via the http request.
Also to note that Sonos seems to be in the middle of creating it's new developer portal and since last Monday ( June 24th ) the new portal no longer references the Acme test service. I'm wondering if this is due to it no longer being valid and it's documentation out of date (est. 2017-2018).
I expect the service to show up in the Sonos Controller when adding a new service but it doesn't appear and the log doesn't show any attempts to connect.
An SSL endpoint is required for production, but you can use a non-SSL endpoint for testing. See the comments in this answer for details: With a Sonos player, adding local service to customSD does not show up Music Services

API GET Authentication

I will start by saying I'm not a developer and don't know too much about API's.
Using BambooHR (Cloud based HR service) I have an API that I can call through a browser and it returns a CSV report. I am looking to automate this but not too sure how to call this through PowerShell to return my file.
The API url looks like this:
HTTP://<API TOKEN >:x#api.bamboohr.com/api/gateway.php/<COMPANY Name>/reports/<report>/?format=csv
When I try the following in Powershell:
Invoke-WebRequest -URI HTTP://<API TOKEN>:x#api.bamboohr.com/api/gateway.php/<COMPANY Name>/reports/<report>/?format=csv
I get the following error:
The underlying connection was closed: An unexpected error occurred on
a send.
Any ideas how I can just create a simple PowerShell script to download this file?
According to bamboohr api documentation you should only use https with signed certificate:
All requests made to our APIs must be sent over HTTPS. The SSL
certificate used for the HTTPS connection is signed and all
implementations should configure their SSL layer to verify it.

wcf https works on my local pc but not in android

I have WCF Service hosted in IIS using https and self sign certificate created from IIS for my local pc
If i enter in my desktop browser the following link:
https://MyHostName:MyPort/MyService.svc WORKS and is secured.
The same link in different pc in my local LAN gives me warning that this site is not secure and asks me to click and verify that i want to proceed and when i do it i can see the service .. ( which i assume has something to do with my certificate)
MAIN PROBLEM
The same link again FAIL using android google chrome with out give me a warning . Just fail with the error "This site can't be reached.... ERR_NAME_NOT_RESOLVED"
Please help.
I am trying to connect to the service from my xamarin Forms android application (https) but before that i try to test the wcf service from my android browser to verify that the service is available before trying to connect
if this is due to certification how can i configure it correctly to be secure? should i buy one?
i was hoping to test my service before proceeding buying one.
anyone has any ideas?
using valid certificate fixed the issue.

The HTTP request was forbidden with client authentication scheme 'Anonymous'. Hitting URL on IE and then calling through web service fixes it

I am trying to call a WCF web service from my .net application which is a web api. I get the error below:
The HTTP request was forbidden with client authentication scheme 'Anonymous'. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
This error is seen until I open IE on the same server where my web api is hosted through IIS, and then I browse to the WCF service URL, it prompts me with the certificate name that I have for the WCF service in my trusted certificate store. Once I click OK on the certificate popup in IE, it goes successfully to the wsdl of the service. After that if I make a call from my webapi it proceeds successfully. But every day it fails until I do that. I know there is something wrong with my certificate setup, but I am not sure how to fix it. Any help is appreciated.

Can't upgrade Azure deployment using Management REST API (SSL certificate issue)

I'm currently working on an automated deployment process for a hosted service for Windows Azure. The creation of the .cspkg and .cscfg files works perfectly using a call to msbuild. Now I'm writing a small .NET console app that should deploy these files to Azure using the Management REST API.
There is no problem concerning the API itself. I can send a request to the API using one of my management certificates. I upload the .cspkg file to Azure BLOB Storage and then try to call Upgrade Deployment. But every time I try, I get a "400 Bad Request" response stating that the certificate with thumbprint xy was not found. This certificate is the SSL certificate (not a management certificate) I'm using for HTTPS for my custom domain (DNS CNAME).
And now, the whole thing gets interesting:
When I deploy the files using the "Publish" command in my Visual Studio, there is no problem. (I compared the .cscfg/.cspkg files from VS and from my msbuild output: apart from a few GUIDs, they're identical). And furthermore, using the Silverlight Management thingy in my browser, I can even upload my generated files that could not be uploaded using the API.
When I retrieve a list of all certificates using the List Certificates call, the certificate which is said to be missing is apparently there. I can also retrieve its data using the Get Certificate call.
So why does Azure keep telling me that the certificate was not found when using the Upgrade Deployment call? Did anyone experience something similar? Has anyone the hint for me? Thanks in advance.
P.S.: This is what Azure says when I use the API:
<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>BadRequest</Code>
<Message>The certitficate with thumbprint 7b232c4a2d6e3deadbeef120d5dbc1fe8049fbea was not found.</Message>
</Error>
P.P.S.: Yes, the word in the response is certitficate, not certificate.
OK, after using the List Subscription Operations API call to find out what Visual Studio calls to deploy apps, I found the solution.
Turns out that the URL I used for the API request was wrong, but: with all due respect, I blame Microsoft for lousily documenting its Azure Management API.
In their documentation, they write the URL to use is:
https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deploymentslots/<deployment-slot>/?comp=upgrade
And the description is the following:
To generate the request URI, replace <subscription-id> with your subscription ID, <service-name> with the name of your service, <deployment-slot> with staging or production, and <deployment-name> with the unique name of your deployment.
What they forgot to mention is, that you have to use the DNS Name of your service, and not the Name! They could at least return an appropriate error message telling you that the service name is invalid, non-existent or doesn't belong to your subscription ID, instead of complaining about some certificate issue.
Thank you Microsoft, that cost me more than two days.
The error indicates that you have not uploaded that certificate into the hosted service's secret store. Visual Studio might be doing that automagically for you, but if you want to replicate it programmatically, then use the Add Certificate API call and upload the PFX into the deployment.
You can see '400 BadRequest - The certificate with thumbprint XYZ was not found.' appear in the CreateDeployment or UpgradeDeployment scenario for the following reason (which I just debugged):
You use the same certificate for subscription management as you do for e.g. SSL or Remote Desktop password encryption in your hosted service. You therefore will use the certificate with thumbprint XYZ to authenticate your service management REST call that creates the deployment.
When specifying your deployment parameters you pass in your CSCFG which references that same cert by its thumbprint, because it needs to configure Remote Desktop/SSL etc.
That cert is not yet added to your hosted service certs.
In this case the 400 Bad Request error really is telling you that you have a bad request, because the certificate in your CSCFG is not yet attached to your hosted service. The confusion arises (for me) because, since its a multi purpose cert, you misinterpret the error message as referring to the authentication of the request, even though you are not getting 401.