[Mono-aspnet-list] Error “Requested listen uri scheme must be http, but was https” using C#,WCS,Apache,Mono,Debian for Rest-Service

Marco K. daily82 at gmx.de
Mon May 27 09:30:58 UTC 2013


Hi there,

recently I startet to create a Rest-Service in C# (WCF Service 
Application). The aim is to use it on a Debian 7-System with apache2 + 
mod-mono + https + basic auth. Everything was working with http. But I 
can do what I want.. it won't work with https. I allways get the 
error-message "Requested listen uri scheme must be http, but was https." 
and don't understand what is wrong. I think I did everything as 
described in various blogs and tutorials in the web.

I correctly configured https, created the self signed certificiate etc. 
and, in fact, https itself is working as it should. But not with the 
service. I also tried to use the service with https on my Win7-Machine 
with IIS-Express 7.5 which worked like a charm. It has to be somethin 
about Linux/Mono/Apache.

Below are my config-files. I hope someone can help me :(

Greetings daily

*Web.config*
========================

     <?xml version="1.0"?>
<configuration>

<system.web>
<compilation debug="true"
  targetFramework="4.0">
</compilation>
<customErrors mode="Off"/>
       <pages controlRenderingCompatibilityVersion="3.5"
  clientIDMode="AutoID"/>
</system.web>
<system.serviceModel>
<services>
       <service name="RestService.RestServiceImpl"
  behaviorConfiguration="ServiceBehaviour">

<endpoint address=""
binding="webHttpBinding"
contract="RestService.IRestServiceImpl"
bindingConfiguration="webHttpTransportSecurity"
behaviorConfiguration="webHttpBindingBehavior" />

</service>

</services>


<bindings>

<webHttpBinding>
<binding name="webHttpTransportSecurity">
<security mode="Transport" />
</binding>
</webHttpBinding>

</bindings>


<behaviors>

<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="false"
          httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>

<endpointBehaviors>
<behavior name="webHttpBindingBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>

</behaviors>

<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>

</system.serviceModel>

<system.webServer>
       <modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>

</configuration>

========================


*Site-Config for Apache*
========================

     <IfModule mod_ssl.c>

<VirtualHost *:443>
         ErrorLog ${APACHE_LOG_DIR}/error.log
     LogLevel warn

         CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

         SSLEngine on
SSLCertificateFile    /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
         SSLOptions StrictRequire
SSLProtocol all -SSLv2

MonoServerPath wcs.mydomain.de "/usr/bin/mod-mono-server4"
         MonoDebug wcs.mydomain.de true
         MonoSetEnv wcs.mydomain.de  MONO_IOMAP=all
MonoAutoApplication  disabled
MonoApplications wcs.mydomain.de "/api:/var/www/wcs"

BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

<Location /api>
SSLRequireSSL
Options FollowSymLinks

Allow from all
Order allow,deny

MonoSetServerAlias wcs.mydomain.de
SetHandler mono

AuthType Basic
AuthName "Authorization required"
AuthUserFile /etc/apache2/htpasswd
Require valid-user
</Location>
</VirtualHost>

========================


More information about the Mono-aspnet-list mailing list