[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


     <?xml version="1.0"?>

<compilation debug="true"
<customErrors mode="Off"/>
       <pages controlRenderingCompatibilityVersion="3.5"
       <service name="RestService.RestServiceImpl"

<endpoint address=""
behaviorConfiguration="webHttpBindingBehavior" />




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



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

<behavior name="webHttpBindingBehavior">


<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>


       <modules runAllManagedModulesForAllRequests="true">



*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>
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


More information about the Mono-aspnet-list mailing list