Heroku 阻止 https 对 img 的请求

问题描述

我使用 docker 文件将我的 ASP.Net Core 项目部署到 heroku:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
workdir /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://*:8080
ENV ASPNETCORE_ENVIRONMENT = "Production"
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
workdir /src
copY ["Welding.Api/Welding.Api.csproj","Welding.Api/"]

RUN dotnet restore "Welding.Api/Welding.Api.csproj"
copY . .
workdir "/src/Welding.Api"
RUN dotnet build "Welding.Api.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "Welding.Api.csproj" -c Release -o /app

FROM base AS final
workdir /app

copY --from=publish /app .

RUN apt-get update \
    && apt-get install -y zlib1g fontconfig libfreetype6 \
        libx11-6 libxext6 libxrender1 \
        libgdiplus libxcb1 xfonts-75dpi xfonts-base \
    && curl -o /app/libwkhtmltox.so \
        --location \
        https://github.com/rdvojmoc/DinkToPdf/blob/master/v0.12.4/64%20bit/libwkhtmltox.so?raw=true \
    && fc-cache -fv

ENTRYPOINT ["dotnet","Welding.Api.dll"]

我的应用程序包括返回 pdf 文件的端点。有标签 img,通过 https 调用 src。我在日志中有错误

QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init

我不能使用 http 类型的请求,因为我使用 QuickChart package获取图表为 img。 另外我想提一下我用于创建 pdf 文档的包:DinkToPdf.Standard。我解决了与 DinkToPdf.Standard 相关的部分问题 - apt-get lines were added to docker file。但不幸的是,我无法通过该问题找到任何有用的信息...... 任何想法请...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)