小编Mil*_*ilo的帖子

如何从 ASP.net core 1.1.2 Httpclient 启用 TLS 1.2

我们正在使用 ASP.net 核心 1.1.2,我们正在调用启用了 TLS1.2 的 HTTPS 服务。当我们从 Httpclient 调用时,我们收到以下安全错误。

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred 
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
   at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext()
Run Code Online (Sandbox Code Playgroud)

有没有办法使用 ASP 核心 1.x 使用 httpclient 启用 TLS1.2

来自邮递员的相同 https 调用工作正常

注意:我们尝试了多种可能性,如下所示,但都没有奏效。

  1. handler.ClientCertificateOptions = ClientCertificateOption.Automatic;
    handler.SslProtocols = SslProtocols.Tls11 |  SslProtocols.Tls12 | SslProtocols.Tls;
    handler.PreAuthenticate = true;
    handler.ServerCertificateCustomValidationCallback += (message, cert, chain, errors) => { return true; };
    
    Run Code Online (Sandbox Code Playgroud)
  2. 我们尝试向注册表项添加选项,这也失败了

新服务器添加了新密码,并且客户端必须支持以下 TLS 1.2 密码套件之一:

TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Run Code Online (Sandbox Code Playgroud)

c# ssl tls1.2 asp.net-core

5
推荐指数
0
解决办法
766
查看次数

Xcode将不会显示在MacOS服务器服务上

我正在使用在High-Sierra上运行的mac,我已经安装了MacOS服务器和xcode。在macOS服务的侧边栏上。Xcode假定如下所示:

在此处输入图片说明

但是在我的macOS服务器上,它没有显示它。

在此处输入图片说明

谁能帮我这个?

macos-high-sierra

5
推荐指数
1
解决办法
801
查看次数

如何让 Windows 允许我安装未签名的应用程序?

.appx从我的大学使用的服务下载了一个文件,该文件最初是为 Windows 手机设计的。

当我尝试安装应用程序(通过双击.appx文件)时,我得到以下信息:

向应用程序开发人员询问新的应用程序包。这个没有使用受信任的证书 (0x800B0100) 签名

如何让应用程序安装成功?

windows

5
推荐指数
1
解决办法
994
查看次数

在 SSRS Tablix 中渲染 HTML 标签

我在 SQLView\columns 之一中有标记文本(HTML 标记),我必须将其在 Tablix 报告中显示为一列中的格式化文本。标记用于粗体、斜体、下划线。

我可以在文本框中启用 HTML,但不能在 Tablix 中启用。您能否建议在我的报告中获取 HTML 标签的选项是什么?

国家/地区是根据用户默认选择的。

reporting-services ssrs-tablix

5
推荐指数
1
解决办法
9762
查看次数

Collectors.toList() 显示错误“预期 3 个参数,但找到 1 个”

为什么我的收藏Collectors.toList()显示此错误:

预期 3 个参数,但发现 1 个

package com.knoldus;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.IntStream;


interface Cityeration<T> {
    public abstract List<T> Cityeration(List<T> first, List<T> Second);
}

public class ListMultiplication {
    public static void main(String s[]) {
        List firstList = Arrays.asList(1, 2, 3, 4, 5);
        List secondList = Arrays.asList(1, 2, 3, 4, 5);

        Cityeration c = (first, second) -> IntStream.range(0, first.size())
                        .map(i -> first.get(i) * second.get(i))
                        .collect(Collectors.toList());
    }
}
Run Code Online (Sandbox Code Playgroud)

java collections java-stream

5
推荐指数
1
解决办法
1482
查看次数

漏洞?System.ArgumentException: '无法找出以下路线:

错误

System.ArgumentException: '无法找出路由: //RegisterPage 参数名称: uri' System.ArgumentException: '无法找出路由: //LogoPage 参数名称: uri'

怎么了?它无法弄清楚路线......?

XAML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="MyApp.Views.WelcomePage"
             Shell.NavBarIsVisible="False">
    <ContentPage.Content>
        <StackLayout Padding="10,0,10,0" VerticalOptions="Center">
            <Button VerticalOptions="Center" Text="Register" Command="{Binding RegisterCommand}"/>
            <Button VerticalOptions="Center" Text="Login" Command="{Binding LoginCommand}"/>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)

背后的代码

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class WelcomePage : ContentPage
{
    public WelcomePage()
    {
        InitializeComponent();
        this.BindingContext = new WelcomeViewModel();
    }
}
Run Code Online (Sandbox Code Playgroud)

欢迎视图模型.cs

public Command RegisterCommand { get; }
public Command LoginCommand { get; }

public WelcomeViewModel()
{
    RegisterCommand = new …
Run Code Online (Sandbox Code Playgroud)

c# xamarin xamarin.forms xamarin.forms.shell

5
推荐指数
2
解决办法
2656
查看次数

.net core API Post异常给出了NativeErrorCode 12175

对于下面的代码,它在调用时捕获HttpRequestException/System.Net.Http.WinHttpException

异常状态:NativeErrorCode 12175
消息"发生安全性错误"

  • e {System.Net.Http.HttpRequestException:发送请求时发生错误.---> System.Net.Http.WinHttpException:System.Runtime.CompilerServices.ConfiguredTaskAwaitable上System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)的System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()发生安全性错误.__CODE__1.ConfiguredTaskAwaiter.GetResult()at System.Net.Http.HttpClient.d__58.MoveNext()---从抛出异常的先前位置开始的堆栈跟踪结束---在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()在Controllers.Controller.d__0.MoveNext()的System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()上的System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)

但是在相同的端点,资源,标题和正文上使用Postman,我得到200回.

NativeErrorCode 12175   
Message "A security error occurred"

-       e   {System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext()
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() …
Run Code Online (Sandbox Code Playgroud)

c# dotnet-httpclient .net-core

4
推荐指数
1
解决办法
5285
查看次数

重新加载 ReactLeaflet 地图的问题

我的地图有问题。一张react-leaflet地图。它在我加载我的网站时显示。但另一方面,就像点击链接一样,它没有。我只是在滚动时一张一张地加载左上角的图块。

以前有人遇到过这个问题吗?或者有人有什么想法?

一个例子:http : //www.noelshack.com/2019-02-1-1546872914-capture.png

import React, { Component } from 'react';
import { Map, Marker, Popup, TileLayer } from 'react-leaflet';
import 'leaflet/dist/leaflet.css';
import './local_leaflet.css';

const mapState = {
  lat: 49.4431,
  lng: 1.0993,
  zoom: 10,
  visible: true,
  url: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
};

export default () => (
  <div>
    <Map center={[mapState.lat, mapState.lng]} zoom={mapState.zoom}>
      <TileLayer url={mapState.url} />
    </Map>
  </div>
);
Run Code Online (Sandbox Code Playgroud)

我已经尝试过componentDidMount, componentDidUpdate, componentWillUnmount... 没有任何效果。

javascript leaflet reactjs react-leaflet extreact

4
推荐指数
1
解决办法
1450
查看次数

如何计算按shortdatestring分组的表的行?

我们有一个具有以下结构的数据库:

public partial class ChartData
{
    public int Id { get; set; }
    public DateTime Timestamp { get; set; }
    public string Function { get; set; }
    public int Duration { get; set; }
    public bool IsError { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

现在,我们要对该数据库的条目进行分组Timestamp.ToShortDateString(),然后计算属于该日期的条目。

因此,例如,我们有:

2019-06-04 11:54:02,135,someFunction,30,False,
2019-06-04 11:55:03,135,someFunction,230,False,
2019-06-04 11:56:03,150,someFunction,4,True,
2019-06-05 11:54:03,230,someFunction,46,False,
2019-06-05 11:55:03,230,someFunction,46,False,
Run Code Online (Sandbox Code Playgroud)

我想要这个结果:

{date: 2019-06-04, rows: 3}
{date: 2019-06-05, rows: 2}

public List <LogFileDTO> GetLogFilesData() 
{
    var items = db.ChartDatas.GroupBy(x = > new {
        x.Timestamp.ToShortDateString
    }).Select(x …
Run Code Online (Sandbox Code Playgroud)

c# linq asp.net

4
推荐指数
1
解决办法
101
查看次数

您可能需要适当的加载程序来处理此文件类型,当前没有配置任何加载程序来处理此文件。”

我正在使用yarn将webpack设置为我的react项目,并且出现此错误:

./src/app.js中的错误67:6模块解析失败:意外的令牌(67:6)您可能需要适当的加载程序来处理此文件类型,当前未配置任何加载程序来处理此文件。参见 https://webpack.js.org/concepts#loaders ??wdm ?:编译失败。

webpack.config.js

const path = require("path");

module.exports = {
    entry: "./src/app.js",
    output: {
        path: path.join(__dirname, 'public'),
        filename: 'bundle.js'
    },
    module:{
        rules:[{
            loader: 'babel-loader',
            test: '/\.(js|jsx)$/',
            exclude: /node_modules/
        }]
    },
    devtool: 'cheap-module-eval-source-map',
    devServer: {
        contentBase: path.join(__dirname, 'public')
    }
}
Run Code Online (Sandbox Code Playgroud)
.babelrc
{
    "presets": ["env", "react","@babel/preset-env"],
    "plugins": [
        "transform-class-properties"
    ]
}
Run Code Online (Sandbox Code Playgroud)

package.json

{
  "name": "react",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "serve": "live-server public/",
    "build": "webpack",
    "dev-server": "webpack-dev-server"
  },
  "dependencies": {
    "babel-cli": "6.24.1",
    "babel-core": "6.25.0",
    "babel-plugin-transform-class-properties": "6.24.1", …
Run Code Online (Sandbox Code Playgroud)

css reactjs

4
推荐指数
2
解决办法
1931
查看次数