I have a behavior exposed as REST API from my Graphite project. The API gives a "404" response code when I try it out over HTTPS site. The same API would respond back with valid data over HTTP site.
Am I missing any security settings in configuration?

asked 15 Jul '20, 10:14

Nitin%20Chhabra's gravatar image

Nitin Chhabra
accept rate: 31%

I figured it out with the help of platform developer.

When you are trying to access the REST API over HTTPS site, there are a couple of updates/additions that need to be made in web.config of your website that's SSL enabled versus the one that's not SSL enabled.

  1. Under section <swaggerwcf></swaggerwcf>, make sure everything all the $$$ entries are set according to your project
    <setting name="InfoDescription" value="$$$Description$$$"/>
    <setting name="InfoVersion" value="1.0"/>
    <setting name="InfoTermsOfService" value="$$$TermsOfService$$$"/>
    <setting name="InfoTitle" value="$$$ProjectTitle$$$"/>
    <setting name="InfoContactName" value="$$$DeveloperName$$$"/>
    <setting name="InfoContactUrl" value="$$$WebsiteURL$$$"/>
    <setting name="InfoContactEmail" value="$$$DeveloperEmail$$$"/>
    <setting name="InfoLicenseUrl" value="http://www.apache.org/licenses/LICENSE-2.0.html"/>
    <setting name="InfoLicenseName" value="Apache 2.0"/>
    <setting name="Host" value="$$$yourwebsite.com$$$"/>
    <setting name="BasePath" value="/rest"/>
    <setting name="Schemes" value="https"/>
  2. Under section <bindings></bindings>, compare and update the binding
    <binding name="restWebHttpBinding" contenttypemapper="EnrollmentPortal.Service.RawWebContentTypeMapper, HollyAdams.EnrollmentPortal-Project, Version=, Culture=neutral, PublicKeyToken=null">
    <security mode="Transport"/>

  3. Under section <servicebehaviors></servicebehaviors>, compare and update behaviors
    <servicemetadata httpsgetenabled="True"/>
    <servicedebug includeexceptiondetailinfaults="False"/>
    <behavior name="GTCServiceBehavior">
    <servicemetadata httpsgetenabled="true"/>
    <servicedebug includeexceptiondetailinfaults="False"/>
  4. Add new section (below section <extensions></extensions>)
    <add scheme="http" binding="webHttpBinding" bindingconfiguration="restWebHttpBinding"/>
    <add scheme="https" binding="webHttpBinding" bindingconfiguration="restWebHttpBinding"/>

Once the above changes are done, perform IIS reset and test the api again.


answered 15 Jul '20, 11:34

Nitin%20Chhabra's gravatar image

Nitin Chhabra
accept rate: 31%

edited 15 Jul '20, 11:55

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 15 Jul '20, 10:14

Seen: 1,338 times

Last updated: 15 Jul '20, 11:55

Powered By:   Graphite