Skip to content

[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

@Junjun-zhao

Description

@Junjun-zhao

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions