Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet-sdk-9.0.100-preview.3.24160.1] The ServicePointManager does not support proxies with the https scheme will pop up when using PeachPied.WordPress.AspNetCore package. #99737

Closed
1 task done
Junjun-zhao opened this issue Mar 12, 2024 · 7 comments · Fixed by #99893

Comments

@Junjun-zhao
Copy link
Member

Junjun-zhao commented Mar 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Application Name: peachpie-wordpress
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.3.24160.1
App & Source Location, attachment checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1992950

Github Link:
https://github.com/iolevel/peachpie-wordpress

Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.203: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.2.24129.7: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.3.24160.1: Fail

Description:
After we Install the PeachPied.WordPress.AspNetCore package and launch the project. The ServicePointManager does not support proxies with the https scheme pops up after clicking Continue button (page will jump to http://localhost:5004/wp-admin/) with the latest .NET 9 version,

Expected Behavior

Page displays successfully.

Steps To Reproduce

Minimal Repro steps (Demo attached WebApplication4.zip):
The machine has dotnet-sdk-9.0.100-preview.3.24160.1 installed.

  1. Create 8.0 Asp.NET Core web App (Razor pages).
  2. Install nuget package: PeachPied.WordPress.AspNetCore.
  3. Add Startup.cs and add below code.
class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
        services.AddResponseCompression();
        services.AddWordPress(options =>
        {
       
        });
    }

    public void Configure(IApplicationBuilder app, IHostEnvironment env, IConfiguration configuration)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        app.UseWordPress();
        app.UseDefaultFiles();
    }
}

5.Modify the main method.

private static void Main(string[] args)
{
     Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(Program).Assembly.Location));
     //
     var host = WebHost.CreateDefaultBuilder(args)
         .UseStartup<Startup>()
         .UseUrls("http://*:5004/")
         .Build();
     host.Run();
}

6.Modify the appsettings.json to connect mysql.

{
  "WordPress": {
    "dbhost": "localhost",
    "dbpassword": "*mysql password*",
    "dbuser": "root",
    "dbname": "wordpress",

  }
}

7.Install MySQL on the machine and start the MySQL service.
8.Restore the SQL with db.sql in the project.
9. Build the project.
10. Change the WebApplication4.runtimeconfig.json

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "9.0.0-preview.3.24157.12"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "9.0.0-preview.3.24157.5"
      }
    ],
    "configProperties": {
      "System.GC.Server": true,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}
  1. Launch the project.
  2. Open edge to “http://localhost:5004/wp-login.php”.
  3. Input admin and the password.txt in the attachments of Devdiv bug.
  4. Click Log in button.
  5. Click the email is correct button.
  6. Click Update WordPress Database button.
  7. Click Continue button.

Expected Result:

Exceptions (if any)

Page redirection failed.

 Value 'CURLOPT_CAINFO' of argument 'option' is not supported
fail: PHP[0]
      System.NotSupportedException: The ServicePointManager does not support proxies with the https scheme.
         at System.Net.ServicePointManager.ProxyAddressIfNecessary(Uri& address, IWebProxy proxy)
         at System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy)
         at System.Net.HttpWebRequest.get_ServicePoint()
         at System.Net.HttpWebRequest.set_ProtocolVersion(Version value)
         at Peachpie.Library.Network.CurlOption_ProtocolVersion.Apply(Context ctx, HttpWebRequest request)
         at Peachpie.Library.Network.CurlOption`2.Peachpie.Library.Network.ICurlOption.Apply(Context ctx, WebRequest request)
         at Peachpie.Library.Network.CURLResource.ApplyOptions(Context ctx, WebRequest request)
         at Peachpie.Library.Network.CURLFunctions.ExecHttpRequestInternalAsync(Context ctx, CURLResource ch, Uri uri)
         at Peachpie.Library.Network.CURLFunctions.StartRequestExecution(Context ctx, CURLResource ch)
         at Peachpie.Library.Network.CURLFunctions.curl_exec(Context ctx, CURLResource ch)
         at WpOrg.Requests.Transport.Curl.request(PhpValue url, PhpValue headers, PhpValue data, PhpValue options)
         at CallSite.Target(Closure, CallSite, PhpValue, Context, PhpValue&, PhpValue&, PhpValue&, PhpValue&)
         at WpOrg.Requests.Requests.request(Context <ctx>, PhpTypeInfo <static>, PhpValue url, PhpValue headers, PhpValue data, PhpValue type, PhpValue options)
         at WP_Http.request(PhpValue url, PhpValue args)
         at WP_Http.post(PhpValue url, PhpValue args)
         at CallSite.Target(Closure, CallSite, PhpValue, Context, PhpValue&, PhpValue&)
         at <Root>wp-includes.http_php.wp_remote_post(Context <ctx>, PhpValue url, PhpValue args)
         at <Root>wp-admin/includes.dashboard_php.wp_check_browser_version(Context <ctx>)
         at <Root>wp-admin/includes.dashboard_php.wp_dashboard_setup(Context <ctx>)
         at <Root>wp-admin.index_php.<Main>(Context <ctx>, PhpArray <locals>, Object this, RuntimeTypeHandle <self>)
         at <Root>wp-admin.index_php.<Main>`0(Context <ctx>, PhpArray <locals>, Object this, RuntimeTypeHandle <self>)
         at Peachpie.AspNetCore.Web.RequestContextCore.ProcessScript(ScriptInfo script, String path_info)

.NET Version

9.0.100-preview.3.24160.1

Anything else?

Dotnet Info:

.NET SDK:
Version:           9.0.100-preview.3.24160.1
Commit:            232d2df252
Workload version:  9.0.100-manifests.9f73df61
MSBuild version:   17.10.0-preview-24127-03+6f44380e4

Runtime Environment:
OS Name:     Windows
OS Version:  10.0.19045
OS Platform: Windows
RID:         win-x64
Base Path:   C:\Program Files\dotnet\sdk\9.0.100-preview.3.24160.1\

 .NET workloads installed:

There are no installed workloads to display.

 Host:

  Version:      9.0.0-preview.3.24157.12
  Architecture: x64
  Commit:       da781b3aab

 .NET SDKs installed:

  9.0.100-preview.3.24160.1 [C:\Program Files\dotnet\sdk]

 .NET runtimes installed:

  Microsoft.AspNetCore.App 9.0.0-preview.3.24157.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.3.24157.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.3.24158.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

@dotnet-actwx-bot @dotnet/compat

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 12, 2024
@gfoidl gfoidl removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 12, 2024
@amcasey
Copy link
Member

amcasey commented Mar 13, 2024

I wonder if #97537 could be involved. @MihaMarkic does this seem like something that should be in https://github.com/dotnet/runtime?

@MihaMarkic
Copy link

I wonder if #97537 could be involved. @MihaMarkic does this seem like something that should be in https://github.com/dotnet/runtime?

Hey, could it be that you're addressing a wrong Miha? :⁠-⁠) I'd gladly answer if I knew the answer, though

@amcasey
Copy link
Member

amcasey commented Mar 13, 2024

My bad, sorry @MihaMarkic! That should have been @MihaZupan.

@MihaZupan MihaZupan transferred this issue from dotnet/aspnetcore Mar 14, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 14, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Mar 14, 2024
@MihaZupan MihaZupan added area-System.Net.Http untriaged New issue has not been triaged by the area owner and removed untriaged New issue has not been triaged by the area owner needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Mar 14, 2024
@MihaZupan
Copy link
Member

@liveans looks like a regression from #97537 now that we're not ignoring ProtocolVersion anymore

@MihaZupan MihaZupan added bug and removed untriaged New issue has not been triaged by the area owner labels Mar 14, 2024
@MihaZupan MihaZupan added this to the 9.0.0 milestone Mar 14, 2024
@Junjun-zhao
Copy link
Member Author

Verified it with dotnet-sdk-9.0.100-preview.4.24174.2, it has been fixed.

@Junjun-zhao
Copy link
Member Author

@liveans Today we verified it on the latest Preview 3 build dotnet-sdk-9.0.100-preview.3.24175.24, this issue still repro.
Could you please confirm whether this issue is a blocker and will it be merged into .NET 9 Preview 3?

@liveans
Copy link
Member

liveans commented Mar 26, 2024

@liveans Today we verified it on the latest Preview 3 build dotnet-sdk-9.0.100-preview.3.24175.24, this issue still repro. Could you please confirm whether this issue is a blocker and will it be merged into .NET 9 Preview 3?

No, the fix will not be backported to Preview 3, the fix will be part of Preview 4.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants