我正在尝试使用加密连接到Web服务器.Web服务器仅允许使用协议TLSv1.2进行连接.
我已经从官方文档中修改了这个片段
import java.net.*;
import java.io.*;
import javax.net.ssl.*;
/*
* This example demostrates how to use a SSLSocket as client to
* send a HTTP request and get response from an HTTPS server.
* It assumes that the client is not behind a firewall
*/
public class SSLSocketClient {
public static void main(String[] args) throws Exception {
try {
String host = "172.20.172.106";
SSLSocketFactory factory =
(SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) factory.createSocket(host, 443);
String[] protocols = socket.getEnabledProtocols(); …Run Code Online (Sandbox Code Playgroud) 我有一个Powershell脚本,应该Invoke-WebRequest对一个网站运行。我想将此脚本与PRTG Network Monitor一起使用,以确保Web服务器正常启动并运行。
当前,该脚本可以在我的本地计算机上运行,也可以在探测服务器上使用我的域凭据运行。但是,当使用PRTG使用的本地管理员凭据登录时,它不会运行。
我把它缩小到一行
Invoke-WebRequest $uri -Method POST -Body $body -TimeoutSec 10
Run Code Online (Sandbox Code Playgroud)
看来,无论出于何种原因,在使用此帐户Invoke-WebRequest时均无法使用。运行该行时,它不会产生任何东西,没有错误,警告或输出。这两个$uri和$body变量已被定义为好。
即使我使用本地admin PRTG帐户登录了探针服务器并以其他用户身份(使用我自己的凭据)运行Powershell,它仍然无法产生任何结果。
为什么本地管理员帐户无法运行Invoke-WebRequest?这是在带有PSVersion 4.0的Windows Server 2012R2上发生的。
是否有任何简单的方法(通过一个脚本)来获取从Windows 2008 Server上的NIC发送和接收的累积字节?
例如,NIC当前显示大约18 MB的已发送数据和765 MB的已接收数据.
由于我的服务器提供商不提供查看每月带宽使用情况的简便方法,因此获取NIC数据似乎是最可靠的.
我知道我可以使用PRTG通过SNMP获取当前的使用数据,但它只是平均值,因为传感器每60秒检查一次.
在我的程序中有一个包含wcf客户端的aspx页面,所以在同一服务器上调用wcf服务.
当我的wcf客户端调用生产服务器上的IIS中托管的wcf服务时,我会得到此异常.
防爆.味精: Thread was being aborted.
Ex堆栈:
在System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr的socketHandle,BYTE*pinnedBuffer,LEN的Int32,的SocketFlags的SocketFlags)在System.Net.Sockets.Socket.Receive(字节[]缓冲液,的Int32偏移的Int32大小,的SocketFlags的SocketFlags,SocketError&的errorCode)在System.Net.Sockets.NetworkStream.Read(字节[]缓冲液,的Int32偏移的Int32大小)在System.Net.PooledStream.Read(字节[]缓冲液,的Int32偏移的Int32大小)在System.Net.Connection .SyncRead(HttpWebRequest的请求,布尔userRetrievedStream,布尔probeRead)在System.Net.ConnectStream.ProcessWriteCallDone(ConnectionReturnResult returnResult)在System.Net.ConnectStream.CallDone(ConnectionReturnResult returnResult)在System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream,布尔suppressWrite )在System.Net.HttpWebRequest.EndWriteHeaders_Part2()在System.Net.HttpWebRequest.EndWriteHeaders(布尔异步)在System.Net.HttpWebRequest.WriteHeadersCallback(WebExceptionStatus ErrorStatus中,ConnectStream流,布尔异步)在System.Net.ConnectStream.WriteHeaders(布尔异步)在System.Net.位于System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)的System.ServiceModel.Channels.RequestChannel.Request(消息消息,TimeSpan超时)处的System.Net.HttpWebRequest.GetResponse()处的HttpWebRequest.EndSubmitRequest()在System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息消息,时间跨度超时)在System.ServiceModel.Channels.ServiceChannel.Call(字符串动作,布尔单向,ProxyOperationRuntime操作,对象[]项,对象[]奏,TimeSpan超时)System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作)在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message))处. Int32类型)在StationService.Station.ClService.GetCurrentStationTrack(String stationId)at StationService.StationServiceClient.GetCurrentStationTrack(String stationId)at GetSongJS.getMarq(String radioIdentifier)位于StationService.StationServiceClient.GetCurrentStationTrack(String stationId)的Station上的PrivateInvoke(MessageData&msgData,Int32类型),位于GetSongJS.getMarq(String radioIdentifier)的StationService.StationServiceClient.GetCurrentStationTrack(String stationId)位于StationService.StationServiceClient.GetCurrentStationTrack(String stationId)的Station上的PrivateInvoke(MessageData&msgData,Int32类型),位于GetSongJS.getMarq(String radioIdentifier)的StationService.StationServiceClient.GetCurrentStationTrack(String stationId)
我使用PRTG Ipmonitor,它给了我太多关于"请求当前"传感器的请求.我的网站在浏览器中变得可用.如果删除这个调用service all的页面就可以了.
prtg ×4
ajax ×1
asp.net ×1
c# ×1
encryption ×1
java ×1
networking ×1
powershell ×1
server ×1
ssl ×1
wcf ×1
windows ×1