Java junior programmers interview summary (four) --http / tcp

Java junior programmers interview summary (four)

Introduction :
I am a novice programmer, coordinate HZ, if you want me to write a blog, you can leave a message, I can try to meet you, each lasting four questions.
Q1 :? You know Http protocol implementation process do
Answer:
1 . DNS resolution for CDN acceleration, parse url, as Host: Port
2. TCP handshake was performed three times
3. the client sends a request to the server line, request header, the request body
4. the server sends a response OK to the client, response headers, response body
5. the browser parses the html code and requests html code resources (such as js, css, images, etc.)
6. client resolver view resources
Q1 : do you know the flow of execution Https agreement do?
Answer:
1 the browser sends the protocol version number, supported algorithms and random number generated by a to the server
2. the server accepts the encryption algorithm the client's hair, according to their own encryption algorithm, encryption algorithm to decide which to use, then the algorithm and digital certificates, and the generated random number B to the client
3. When the client certificate to the server through the transmission of the certificate to obtain an asymmetric encryption company D, C generates a random number, encrypting the C and D to give E is sent to the server.
4. When the server receives this E, with the private key Secret get C, server assembly of A, B, C, ABC is generated using the session encryption key, because the client get A, B, C so that both sides can carry out encryption and decryption.
Q1 : Do you know the shortcomings Https do?
Answer: Https will reduce the user access speed, increase server resource consumption .Https apply encryption protocol, increased operating costs Baidu priority on Https display effect is not obvious, Google sites does not involve significant private information without Https compatibility is not enough .Https... security procedures limited .Https maintenance problems.
Q1 : do you know TCP three-way handshake and waved it four times?
Answer:. TCP3 handshake, the first client sends a random number SYN, and placed himself send a second state service the client side of the SYN + 1 becomes ACK, and a randomly generated the SYN. third, the client receives the ACK and validation, as the SYN + 1 ACK back end service, and to place their own communication state.
4 waving, the first client sends a FIN random number, and to place himself send state to the second server as the ACK FIN + 1. the third-party server as the ACK FIN + 1, and transmits a random number as the FIN the fourth after receiving a FIN +1 returned as ACK, placed in the original state.


Https about the advantages and disadvantages can properly prepare, I personally do not like to use Https although it has a lot of free certificates, but not 100% safe, and search engines are not well displayed.

Released four original articles · won praise 4 · Views 1359

Guess you like

Origin blog.csdn.net/qq_21010115/article/details/104884735