none
How to get SSL Setting (Required SSL checkbox value) using c# RRS feed

  • Question

  • Hi,
     
    We have a scenario where we need to dynamically get the IIS SSL setting like (Required SSL checkbox value) from our codebehind. If user checked/unchecked the checkbox we need to get the value from our codebehind using C#.
     
    Is anyone have an idea. how to get the SSL setting values?
     
    Thanks,
    Bijay.

    Thursday, June 28, 2012 6:29 AM

Answers

All replies

  • Hope this link resolves much of your query part.


    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Thursday, June 28, 2012 6:49 AM
  • Hi,

    I am able to retrive the "Require SSL" checkbox value dynamically by using ServerManager

    My sample is working fine as long as i am not hosting the application. If i host the application in IIS and try to retrive the "Require SSL" checkbox value then i am geeting an error "Can't read configuration file due to insufficient permissions"

    How to resolve the above issue? Is any one have anyidea or sample will be the greate help.

    Thanks,
    Bijay 


    • Edited by bijayece Friday, June 29, 2012 9:04 AM
    Friday, June 29, 2012 8:57 AM
  • try posting your code using "Insert Code Block"

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Friday, June 29, 2012 9:03 AM
  • Hi Bijayece,

    Welcome to the MSDN  Forum.

    Please try to post the text code here rather than picture.

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, June 29, 2012 2:29 PM
    Moderator
  • Hi,

    I am able to retrive the "Require SSL" checkbox value dynamically by using ServerManager

    My sample is working fine as long as i am not hosting the application. If i host the application in IIS and try to retrive the"Require SSL" checkbox value then i am geeting an error "Can't read configuration file due to insufficient permissions"

    Here is the code:

    publicstring GetSSLValue()
    {        

        string bResult = string.Empty;
        using(ServerManagerserverManager = newServerManager())
        {     
         
    try
            {                
             
    Configurationconfig = serverManager.GetApplicationHostConfiguration();
              ConfigurationSectionaccessSection = config.GetSection("system.webServer/security/access", @"Default Web Site/Test");               

              bResult = accessSection["sslFlags"]).ToString();

              }         

    catch(Exceptionex){

    Console.WriteLine(ex.Message);

              }         

    }

    returnbResult;

     }

    How to resolve the above issue? Is any one have anyidea or sample will be the greate help.

    Thanks,
    Bijay


    • Edited by bijayece Monday, July 2, 2012 6:30 AM
    Monday, July 2, 2012 6:29 AM
  • hope this can throw some light.

     


    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Tuesday, July 3, 2012 6:38 AM