Couldn't you just catch the System.Net.WebException and pass your message up? This is approach #1 from the Mono site here: Using Trusted Roots Respectfully. There are a number of more (and a couple less) involved responses there if you'd like to do more, but catching the exception avoids the coding-to-runtime problem tobsen refers to.