Saturday, July 24, 2010

SOLVED: The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via

HTTPS worked, but now it complains if I change to HTTP...You receive the error message:

The provided URI scheme 'http' is invalid; expected 'https'.
Parameter name: via

… while using WCF to connect to an endpoint.

Probably you are trying to send a a username and password to authenticate although the connection is not secure (no HTTPS).

This modified binding should help:

<binding name="UserPasswordBinding">
security mode="TransportCredentialOnly">
transport clientCredentialType="Basic" />
/security>
/binding>

16 comments:

  1. Thank you so much !
    What a pain in the a** this conf file :p

    ReplyDelete
  2. 2 years later, Thanks a lot!!!

    ReplyDelete
  3. Another 2 years later comment. Was assigned an OOOOOOLD service which was using an HTTPS endpoint originally but I was rewriting it and needed to use HTTP to test locally. Got this issue and solved it in less than 2 minutes via google and this post.

    My endpoint was being set up in code rather than a config, but the same problem/solution holds.


    Thanks!

    ReplyDelete
  4. Despues de 4 años, Gracias, tu comentario me sirvio para complementar una conexion a java desde c sharp :D

    ReplyDelete
  5. 4 years later, Thanks men! :)

    ReplyDelete
  6. finally a useful answer ! yay

    ReplyDelete
  7. Thanks a lot !!!!!!

    ReplyDelete
  8. Lucian Mic - thank you, it helped a lot.

    ReplyDelete
  9. Thanks. You saved my time :)

    ReplyDelete
  10. You are a life saver! Awesome. Many thanks

    ReplyDelete
  11. Almost 9 years later and still saving lives :)

    ReplyDelete
  12. Almost 9 years later, still saving lives

    ReplyDelete
  13. GOD, YES!! Thank you, dude!
    9 years of excellent advise ))

    ReplyDelete