Web test result for a URL which needs a client certificate to authenticate

Hi,
we want to check URL response of a .asmx URL which needs a client certificate for authenticating.
I got the cert object and then passed it to invoke-webrequest cmdlet, but no matter what i try I always get this error
“The underlying connection was closed”.
code1
$WebClient = New-Object System.Net.WebClient
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$WebClient.DownloadString(“https://server1/mywebservices/myser.asmx”)
code2
$url=”https://server1/mywebservices/myser.asmx”
$cert=(Get-ChildItem cert: -Recurse | where {$_.Thumbprint -eq “abcdefgh3333…..something”}| Select -First 1)
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
#load my client certificate defined by thumbprint
$HTTP_Request = [System.Net.WebRequest]::Create($url)
$HTTP_Request.ClientCertificates.Add($cert )
# We then get a response from the site.
$HTTP_Response = $HTTP_Request.GetResponse()
Can someone please help me.
Thanks
Manish

Hi Anna
Thanks for the reply.
I used the function referred earlier in my script, as below.
It is still throwing error. However it does work in powershell v2.
Is there any specific change required in the script to make it work with V3. I tried invoke-webrequest and it failed too.
function Ignore-SSLCertificates
    $Provider = New-Object Microsoft.CSharp.CSharpCodeProvider
    $Compiler = $Provider.CreateCompiler()
    $Params = New-Object System.CodeDom.Compiler.CompilerParameters
    $Params.GenerateExecutable = $false
    $Params.GenerateInMemory = $true
    $Params.IncludeDebugInformation = $false
    $Params.ReferencedAssemblies.Add("System.DLL") > $null
    $TASource=@'
        namespace Local.ToolkitExtensions.Net.CertificatePolicy
            public class TrustAll : System.Net.ICertificatePolicy
                public bool CheckValidationResult(System.Net.ServicePoint sp,System.Security.Cryptography.X509Certificates.X509Certificate cert, System.Net.WebRequest req, int problem)
                    return true;
    $TAResults=$Provider.CompileAssemblyFromSource($Params,$TASource)
    $TAAssembly=$TAResults.CompiledAssembly
    ## We create an instance of TrustAll and attach it to the ServicePointManager
    $TrustAll = $TAAssembly.CreateInstance("Local.ToolkitExtensions.Net.CertificatePolicy.TrustAll")
    [System.Net.ServicePointManager]::CertificatePolicy = $TrustAll
$url="https://server1/mywebservices/myser.asmx"
$certs = Get-ChildItem Cert:\CurrentUser\My | where {
$_.Thumbprint -eq “abcdefgh3333…..something”} 
$HTTP_Request = [System.Net.WebRequest]::Create($url)
Ignore-SSLCertificates
try
    $HTTP_Request.ClientCertificates.Add($certs )
    # We then get a response from the site.
    $HTTP_Response = $HTTP_Request.GetResponse()
catch [System.exception]
    Write-Error $error[0].Exception
$HTTP_Status = [int]$HTTP_Response.StatusCode
Manish

Similar Messages

  • Unable to download web test results for failed Availability Monitor request - HTTP 500

    When attempting to download the Web Test results for a failed request in my availability monitor, the server returns HTTP 500.
    The full URL attempting to be accessed is https://stamp2.app.insightsportal.visualstudio.com/api/WebTestResult?fileName=eProd Dx1 Api_2015-02-25T16:58:00.000Z.webtestresult&subscriptionId=REMOVEDFORSECURITYPURPOSES&resourceGroup=eprod-dx1webapi&webTestId=eprod
    dx1 api-eprod-dx1webapi&location=us-ca-sjc-azr&timestamp=1424883480
    I can provide the sub ID as needed.

    Thinking this is an Azure Portal issue. Please move.

  • I am trying to access a webpage but it keeps saying I need a client certificate. Even after I click 'continue', I still cannot access the webpage.

    I am trying to access a webpage but it keeps saying I need a client certificate. Even after I click 'continue', I still cannot access the webpage.

    https://etivity.sul.com.au/
    It's to access my work rosters.

  • SCOM 2012 R2 - How to create a Web Application Monitor for an URL requiring certificate authentication

    Hi All,
    It looks like in SCOM 2012 there are two ways to monitor a web application (URL monitoring):
    Way no 1: (Using the Web Application Transaction Monitoring template)
    Way no 2: (Using the Web
    Application Availability Monitoring template)
    We have created some monitors using
    Web Application Availability Monitoring to check if URL is up without any authentication method.
    However, we have few URLs for which we need Client Certificates to be used for accessing them but found no option in SCOM 2012 to configured the certificates. 
    I have searched a lot on the Tech Net library but no clue.  Does anyone know how to successfully monitor an URL requiring certificate authentication on SCOM 2012 ? or, at least, using no matter which method?
    Thanks.
    Regards,
    Raju.

    Hi,
    Based on my research, it is not possible by using the built-in monitoring templates. Both of them handles “normal”, server-side, SSL-certs, and the transaction monitor handles basic/digest/NTLM authentication, but client certificate based authentication
    is not a configurable option.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • A web service that calls another ws which need authentication

    Hi,
    I need to call a web service which need authentication.
    I've used the following code:
    SystemMsg sm = new SystemMsg();
    sm.setMsgType("Test");
    sm.setMsgDesc("Test");
    sm.setDateTime("Test");
    SystemMsgOB acbss = new SystemMsgOBBindingStub();
    acbss._setProperty(SystemMsgOB.USERNAME_PROPERTY, "user");
    acbss._setProperty(SystemMsgOB.PASSWORD_PROPERTY, "password");
    acbss.systemMsgOB(sm);
    When I try to run the project from the J2EE engine I get an exception: java.lang.IncompatibleClassChangeError.
    When debugging I found that the method that causes the trouble is the _setProperty.
    I'll appreciate any help.
    Yaniv.

    Hi Yaniv,
    This error previously only occurred if the inqmyxml.jar archive was enhanced incompatibly.
    1) Terminate the SDM. Copy the inqmyxml.jar              file from the deploying/lib subdirectory of the J2EE installation directory into the lib subdirectory of the SDM.
    2) Make sure that you remove the original file from the lib subdirectory.
    3) In particular, the file must not remain renamed in the lib subdirectory. Then restart the SDM and repeat the deployment by selecting "Restart".
    Hope it helps,
    Regards,
    Nagarajan.

  • Test results for PrintService example needed

    I have just added a demo of the PrintService to
    the web start examples at physci.
    http://www.physci.org/jws/#prs
    Slight hitch in testing, though - there is no printer
    attached to this development box.
    Would anybody with a printer, care to open one
    or two short documents, fire off a test print, and
    report back?
    Does it work at all?
    Does the print work well?
    The code is sandboxed, & an archive of the
    source (*.java, *.jnlp & build.xml) is also
    available at the link.

    I am guessing this isn't the entire problem, but I don't see that memcpy is a supported Windows Store API:
    http://msdn.microsoft.com/en-us/library/windows/apps/dn424765.aspx
    Do you see anywhere else that says it is supported?
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Saving test results for retrieval later.

    I have a program that works for testing semiconductors using GPIB control of some HP equipment. The problem is that although it looks like it saves properly (lets me choose directory and name the file), I cannot retrieve any files. When I try to retrieve, the program automatically brings up the last test saved. I am using Open/Create/Replace File, Write File, Close File and Read File. I have an event structure loop that has the options: Run Test, Save Test, Recall Data and Quit. As soon as I hit the recall button the last test saved appears on my graph and output array indicator, then the window comes up asking me for file name etc. I am using LabVIEW 7.0. Any ideas?

    I believe I am closing the refnum by using the FileClose VI. I have attached a simpler version of my program that is doing the same thing. I used local variables to create the data types for saving and recalling the files. Do I need to add the file extension when I name the file I am saving? Thank you for looking at this.
    Attachments:
    File_I-O_trial.vi ‏216 KB

  • Speed Tests Results for 802.11ac Wireless Connections

    Using the new Apple MacBook Air with 802.11ac wireless, I tested copying a file and a folder to both the new 802.11ac AirPort Extreme router housing a USB-connected hard disk and the less recent 802.11n Apple AirPort Extreme router housing a similar USB-connected hard disk.
    The results of the tests are summarized in the table below. The movie file was ripped from a DVD movie, and the Microsoft folder is simply the Microsoft Office 2011 folder in my Applications folder containing 14,231 items.
    The MacBook Air computer was located 6–8 feet away from each router with no intervening obstructions. While this was not a scientific test, it demonstrated to me that 802.11ac wireless is clearly superior to 802.11n in a real world setting. I assume that the lower relative performance of 802.11ac versus 802.11n for the large folder containing many files is due to overhead in copying and writing files from and to the hard disks. Ditto for the Gigabit Ethernet test.

    Great resource for speedtesting: www.speedtest.net
    Will show you ping speed, upload/download speeds for your connection. Try for each then post results.

  • Need to download Design & Web Premium CS6 for Windows [was: I need help]

    I need to talk to someone. I was emailed a download for cs6 from journey ed and it is just a partial download and will not let me open it. Journey Ed told me to call you

    You can download it from http://prodesigntools.com/adobe-cs6-direct-download-links.html (You will require your serial number)
    BEFORE you click the download links, you must follow the Very Important Instructions on that page FIRST.
    Then click to download the trial version (Windows version), install it and enter your serial number to license it.

  • IOS4,  apple-mobile-web-app-capable and client certificates

    IOS4 (4.0 and 4.0.1) seems to have broken apple-mobile-web-app-capable. I have a webbapplication using client certificates to authenticate the user. This worked flawless on IOS3.x. However, after having upgraded my iPhone to IOS4, the application fails when started from the springboard with an error message telling a client certificate is required (I have one installed). When I start the application from within Safari it works OK. I tracked the error down to the following line in the HTML code:
    <meta name="apple-mobile-web-app-capable" content="yes" />
    When I remove this line, the application works again flawless when started from the springboard. However the native look and feel are gone. As soon as I add this line to the HTML, the application works when started from Safari, but fails when started from the springboard.
    Does anyone have a glue or is this a bug on the apple-mobile-web-app-capable function of IOS4?

    I have also experienced this problem on iOS 4.1. I want to authenticate access to a web-app using SSL client certificates but I get an error "Cannot Open ... requires a client certificate" when launching the app from the home screen. Very annoying!
    Navigating to the page in Safafi prompts the user to choose which certificate to use and then loads the page successfully. Just as a side question, is there anyway to automatically associate a client certificate with a web site so that the user is never prompted to choose a certificate when accessing the site? I want an authentication process that is transparent to the user.

  • Load Test Results - time series request data for by URL in VS2013

    I am trying to figure out how to export and then analyze the results of a load test, but after the test is over it seems I cannot find the data for each individual request by url. This data shows during the load test itself, but after it is over it seems
    as if that data is no longer accessible and all I can find are totals. The data that I want is under the "Page response time" graph on the graphs window during the test. I know this is not the response time for every single request and is probably
    averaged, but that would suffice for the calculations I want to make. 
    I have looked in the database on my local machine (LoadTest2010, where all of the summary data is stored) and I cannot find the data I'm looking for. 
    My goal is to plot (probably in excel) each request url against the user load and analyze the slope of the response time averages to determine which requests scale the worst (and best). During the load test I can see this data and get a visual idea but when
    it ends I cannot seem to find it to export. 
    A) Can this data be exported from within visual studio? Is there a setting required to make VS persist this data to the database? I have, from under Run Settings, the "Results" section "Timing Details Storage" set to "All individual
    details" and the Storage Type set to "Database". 
    B) If this data isn't available from within VS, is it in any of the tables in the LoadTest2010 database where all of the summary data is stored?
    Thanks
    Luke

    Hi Luke,
    Since the load test is used to
    simulate many users accessing a server at the same time, it is mainly verify a wev server load stress.
    As you said that you want to find the data
    for each individual request by url, I know that generally we can analyze the url request from the Summary like the following screen shot.
    >>I
    have looked in the database on my local machine (LoadTest2010, where all of the summary data is stored) and I cannot find the data I'm looking for. 
    I suggest you can try to add the
    SQL Tracing Connect String in the Run Setting properties to trace the data.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/74ff1c3e-cdc5-403a-b82f-66fbd36b1cc2/sql-server-tracing-in-visual-studio-load-test?forum=vstest
    In addition, you can try to create an excel to analyze the load test result, for more information:
    http://msdn.microsoft.com/en-us/library/dd997707.aspx
    Hope it help you!
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Test Script for Billing

    Hello Experts,
    I would like create test script for Billing.Since i have no clue about test script coz in my previous organization we have not made any script for testing.Now i would like to create testing for Billing.
    Could you all explain me what are the pre - requisites for testing only for Billing.
    What are the different ways for testing to perform since i have never worked on testing on documentations.
    Your reply would appreciate.
    Thanks
    Shri...

    Test script is nothing but unit testing through which you list down the steps that are needed to execute a test case and record the results.
    In your case, since you wanted a test script for billing, first you need to identify the different types of billing documents configured in production client.  For each and every billing document type, you need to create a test document and record in the following format
    Test Scenario No.
    Scenario:::Billing
    No.::TCode:::Description:::Input Data:::Output Data:::Remarks (OK/Error)
    We call this process as ASAP Methodology.  The prescribed format you can get in service market place.
    thanks
    G. Lakshmipathi

  • AVK test results

    I am new to Using AVK for my JSP web Application.
    My Environment:
    jdk1.4
    Struts 1.2
    hibernate3
    OC4J 10g (9.0.4)
    SQL server2000
    LDAP
    Plum tree portal.
    I am new to using AVK.
    I need to generate AVK test results for my Customer requirement.
    Where Can i get information ?
    What are jars i need to download ?
    Raghu

    Ideally, I'd like to find a test plan and/or results from the test plan. I've found reference in the Java platform specification indicating that it
    "satisfies all testing requirements available from Sun relating to the most recently published version of the Specification six (6) months prior to any release of the clean room implementation or upgrade thereto..."
    but I have not found what the testing requirements are that have been satisfied. Any ideas?
    Many Thanks,
    -E

  • ABAP HR-test scenario for payslip-urgent

    Hi,
    please send me some test scenarios for payslip by which payslip can be affected.
    I have designed a PAyslip with retro and i want to test it.
    eg. retro. means if retro will run then it will affect payslip.
    Also send me some unit test cases in case of any payslip requirement.
    Points will be rewarded.
    Regards
    Monika

    Hi,
    Just give an entry in infotype 8, 14 or 15 for previous month and run the payroll than retro will run, than compare results using wage type reporter.
    When you run the payroll give the sandard SAP Remuneration and compare the results in the SAP payslip and payslip you have developed.
    If you have developed payslip using PE51 than the retro amounts are picked authomatically.
    Regards,
    Ramu N.

  • Test scenario for payslip testing

    Hi,
    please send me some test scenarios for payslip by which payslip can be affected.
    eg. retro. means if retro will run then it will affect payslip.
    Also send me some unit test cases in case of any payslip requirement.
    Regards

    Hi,
    Just give an entry in infotype 8, 14 or 15 for previous month and run the payroll than retro will run, than compare results using wage type reporter.
    When you run the payroll give the sandard SAP Remuneration and compare the results in the SAP payslip and payslip you have developed.
    If you have developed payslip using PE51 than the retro amounts are picked authomatically.
    Regards,
    Ramu N.

Maybe you are looking for