Inverse the value place of matrix - matrix
I'am trying to inverse a matrix(actually it is a s-box for AES). The dimensions are 10*16 (10 rows and 16 columns)
The box is filled up with numbers and I want to inverse this box
like this :
a[0][0]=63 (for example in the first row/column the value is 63)
after inverse operation:
a[6][3]=00 i want change it with this
I tried some algorithms but didn't work
Well, in the page you linked the matrix is 16x16 and it's stored in a single 1D array of hexadecimal values. The inversion is the easiest part of that algorythm. I'll give you a c++ code for example:
#include <iostream>
#include <iomanip>
#define ROWS 16
#define COLS 16
#define N_ELEMENTS 256
void Invert(unsigned char * in, unsigned char * out) {
for ( int i = 0; i < N_ELEMENTS; i++ ) out[in[i]] = i;
}
void showMatrix(unsigned char * m) {
for ( int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
std::cout << " " << std::setbase(16) << std::setfill('0') << std::setw(2)
<< (unsigned int)m[i*COLS + j];
}
std::cout << std::endl;
}
}
int main() {
unsigned char s[256] = {
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
};
unsigned char inv[256];
Invert(s,inv);
std::cout << "This is the original matrix:\n";
showMatrix(s);
std::cout << "\nThis is the inverted matrix:\n";
showMatrix(inv);
return 0;
}
The output is this:
This is the original matrix:
63 7c 77 7b f2 6b 6f c5 30 01 67 2b fe d7 ab 76
ca 82 c9 7d fa 59 47 f0 ad d4 a2 af 9c a4 72 c0
b7 fd 93 26 36 3f f7 cc 34 a5 e5 f1 71 d8 31 15
04 c7 23 c3 18 96 05 9a 07 12 80 e2 eb 27 b2 75
09 83 2c 1a 1b 6e 5a a0 52 3b d6 b3 29 e3 2f 84
53 d1 00 ed 20 fc b1 5b 6a cb be 39 4a 4c 58 cf
d0 ef aa fb 43 4d 33 85 45 f9 02 7f 50 3c 9f a8
51 a3 40 8f 92 9d 38 f5 bc b6 da 21 10 ff f3 d2
cd 0c 13 ec 5f 97 44 17 c4 a7 7e 3d 64 5d 19 73
60 81 4f dc 22 2a 90 88 46 ee b8 14 de 5e 0b db
e0 32 3a 0a 49 06 24 5c c2 d3 ac 62 91 95 e4 79
e7 c8 37 6d 8d d5 4e a9 6c 56 f4 ea 65 7a ae 08
ba 78 25 2e 1c a6 b4 c6 e8 dd 74 1f 4b bd 8b 8a
70 3e b5 66 48 03 f6 0e 61 35 57 b9 86 c1 1d 9e
e1 f8 98 11 69 d9 8e 94 9b 1e 87 e9 ce 55 28 df
8c a1 89 0d bf e6 42 68 41 99 2d 0f b0 54 bb 16
This is the inverted matrix:
52 09 6a d5 30 36 a5 38 bf 40 a3 9e 81 f3 d7 fb
7c e3 39 82 9b 2f ff 87 34 8e 43 44 c4 de e9 cb
54 7b 94 32 a6 c2 23 3d ee 4c 95 0b 42 fa c3 4e
08 2e a1 66 28 d9 24 b2 76 5b a2 49 6d 8b d1 25
72 f8 f6 64 86 68 98 16 d4 a4 5c cc 5d 65 b6 92
6c 70 48 50 fd ed b9 da 5e 15 46 57 a7 8d 9d 84
90 d8 ab 00 8c bc d3 0a f7 e4 58 05 b8 b3 45 06
d0 2c 1e 8f ca 3f 0f 02 c1 af bd 03 01 13 8a 6b
3a 91 11 41 4f 67 dc ea 97 f2 cf ce f0 b4 e6 73
96 ac 74 22 e7 ad 35 85 e2 f9 37 e8 1c 75 df 6e
47 f1 1a 71 1d 29 c5 89 6f b7 62 0e aa 18 be 1b
fc 56 3e 4b c6 d2 79 20 9a db c0 fe 78 cd 5a f4
1f dd a8 33 88 07 c7 31 b1 12 10 59 27 80 ec 5f
60 51 7f a9 19 b5 4a 0d 2d e5 7a 9f 93 c9 9c ef
a0 e0 3b 4d ae 2a f5 b0 c8 eb bb 3c 83 53 99 61
17 2b 04 7e ba 77 d6 26 e1 69 14 63 55 21 0c 7d
Something like this should do the trick, although there's probably a more efficient way.
Matrix Invert(Matrix in)
{
Matrix out = new Matrix[10][16];
for(int i = 0; i < 10; i++)
{
for(int j = 0; j < 16, j++)
{
int row = Math.Floor(in[i][j] / 16);
int column = in[i][j] % 16;
out[row][column] = i * 16 + j;
}
}
return out;
}
Related
Decoding a Huffman AC table from JpegSnoop
I have an AC Huffman table generated as follows: Destination ID = 1 Class = 1 (AC Table) Codes of length 01 bits (000 total): Codes of length 02 bits (002 total): 00 01 Codes of length 03 bits (001 total): 02 Codes of length 04 bits (002 total): 03 11 Codes of length 05 bits (004 total): 04 05 21 31 Codes of length 06 bits (004 total): 06 12 41 51 Codes of length 07 bits (003 total): 07 61 71 Codes of length 08 bits (004 total): 13 22 32 81 Codes of length 09 bits (007 total): 08 14 42 91 A1 B1 C1 Codes of length 10 bits (005 total): 09 23 33 52 F0 Codes of length 11 bits (004 total): 15 62 72 D1 Codes of length 12 bits (004 total): 0A 16 24 34 Codes of length 13 bits (000 total): Codes of length 14 bits (001 total): E1 Codes of length 15 bits (002 total): 25 F1 Codes of length 16 bits (119 total): 17 18 19 1A 26 27 28 29 2A 35 36 37 38 39 3A 43 44 45 46 47 48 49 4A 53 54 55 56 57 58 59 5A 63 64 65 66 67 68 69 6A 73 74 75 76 77 78 79 7A 82 83 84 85 86 87 88 89 8A 92 93 94 95 96 97 98 99 9A A2 A3 A4 A5 A6 A7 A8 A9 AA B2 B3 B4 B5 B6 B7 B8 B9 BA C2 C3 C4 C5 C6 C7 C8 C9 CA D2 D3 D4 D5 D6 D7 D8 D9 DA E2 E3 E4 E5 E6 E7 E8 E9 EA F2 F3 F4 F5 F6 F7 F8 F9 FA Total number of codes: 162 I need to find the Mincode, Maxcode and Valptr values from this table. Apparently the decode procedure is not similar to the one of the DC table. The following answer explains the retrieval of these values from a DC table: answer
The generation of those tables and the Huffman decoding of the eight-bit value is exactly the same for AC and DC coefficients. What you do with the resulting eight-bit values is different.
How To Construct A Shellcode From x64 MASM Assembly
im trying to make a small messagebox shellcode, using masm assembler, im doing so because im not that familiar with other syntaxes, this is the assembly code main.asm: EXTRN __imp_ExitProcess:PROC EXTRN __imp_MessageBoxA:PROC .code $HELLO DB 'MessageBox From Asm', 00H $WORLD DB 'Hello World !', 00H main PROC sub rsp, 40 xor ecx, ecx lea rdx, OFFSET $WORLD lea r8, OFFSET $HELLO xor r9d, r9d call QWORD PTR __imp_MessageBoxA xor ecx, ecx call QWORD PTR __imp_ExitProcess add rsp, 40 ret 0 main ENDP END im keeping everything as default settings, (i mean in the linker options ...) so far i tried some tools, but none is talking about masm, i found that .obj file may be useful, so i tried: dumpbin /disasm main.obj /rawdata:bytes Microsoft (R) COFF/PE Dumper Version 14.31.31107.0 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file main.obj File Type: COFF OBJECT $HELLO: 0000000000000000: 4D 0000000000000001: 65 73 73 jae 0000000000000077 0000000000000004: 61 0000000000000005: 67 65 42 6F outs dx,dword ptr gs:[esi] 0000000000000009: 78 20 js 000000000000002B 000000000000000B: 46 72 6F jb 000000000000007D 000000000000000E: 6D ins dword ptr [rdi],dx 000000000000000F: 20 41 73 and byte ptr [rcx+73h],al 0000000000000012: 6D ins dword ptr [rdi],dx 0000000000000013: 00 48 65 add byte ptr [rax+65h],cl 0000000000000016: 6C ins byte ptr [rdi],dx 0000000000000017: 6C ins byte ptr [rdi],dx 0000000000000018: 6F outs dx,dword ptr [rsi] 0000000000000019: 20 57 6F and byte ptr [rdi+6Fh],dl 000000000000001C: 72 6C jb 000000000000008A 000000000000001E: 64 20 21 and byte ptr fs:[rcx],ah 0000000000000021: 00 48 83 add byte ptr [rax-7Dh],cl 0000000000000024: EC in al,dx 0000000000000025: 28 33 sub byte ptr [rbx],dh 0000000000000027: C9 leave 0000000000000028: 48 8D 15 00 00 00 lea rdx,[$WORLD] 00 000000000000002F: 4C 8D 05 00 00 00 lea r8,[$HELLO] 00 0000000000000036: 45 33 C9 xor r9d,r9d 0000000000000039: FF 15 00 00 00 00 call qword ptr [__imp_MessageBoxA] 000000000000003F: 33 C9 xor ecx,ecx 0000000000000041: FF 15 00 00 00 00 call qword ptr [__imp_ExitProcess] 0000000000000047: 48 83 C4 28 add rsp,28h 000000000000004B: C3 ret RAW DATA #1 00000000: 4D 65 73 73 61 67 65 42 6F 78 20 46 72 6F 6D 20 MessageBox From 00000010: 41 73 6D 00 48 65 6C 6C 6F 20 57 6F 72 6C 64 20 Asm.Hello World 00000020: 21 00 48 83 EC 28 33 C9 48 8D 15 00 00 00 00 4C !.H.ì(3ÉH......L 00000030: 8D 05 00 00 00 00 45 33 C9 FF 15 00 00 00 00 33 ......E3Éÿ.....3 00000040: C9 FF 15 00 00 00 00 48 83 C4 28 C3 Éÿ.....H.Ä(Ã so i thought, maybe this is the shellcode: 0x4D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6F, 0x78, 0x20, 0x46, 0x72, 0x6F, 0x6D, 0x20, 0x41, 0x73, 0x6D, 0x00, 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x20, 0x21, 0x00, 0x48, 0x83, 0xEC, 0x28, 0x33, 0xC9, 0x48, 0x8D, 0x15, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x8D, 0x05, 0x00, 0x00, 0x00, 0x00, 0x45, 0x33, 0xC9, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x00, 0x33, 0xC9, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xC4, 0x28, 0xC3 but it crashed when testing, any help on the topic would be appreciated, thanks for your time :) .
java.io.EOFException: SSL peer shut down incorrectly with FTPS server connection
Following exception is thrown while connecting to FTPS server : java.io.EOFException: SSL peer shut down incorrectly Server certificate is added in jre/lib/security/cacerts. Tried with JDK8 and JDK11, but it fails with same exception. How to fix this issue. javax.net.debug log (ServerHelloDone onwards) : __________________________________ *** ServerHelloDone [read] MD5 and SHA1 hashes: len = 4 0000: 0E 00 00 00 .... *** ECDHClientKeyExchange ECDH Public value: { 4, 178, 153, 201, 133, 162, 82, 146, 241, 49, 176, 247, 206, 20, 125, 91, 178, 230, 144, 68, 55, 50, 206, 9, 115, 136, 61, 103, 201, 44, 57, 168, 54, 247, 56, 156, 160, 242, 47, 107, 79, 46, 240, 67, 59, 190, 97, 8, 204, 68, 102, 129, 40, 76, 83, 132, 129, 199, 59, 101, 104, 76, 231, 104, 49 } [write] MD5 and SHA1 hashes: len = 70 0000: 10 00 00 42 41 04 B2 99 C9 85 A2 52 92 F1 31 B0 ...BA......R..1. 0010: F7 CE 14 7D 5B B2 E6 90 44 37 32 CE 09 73 88 3D ....[...D72..s.= 0020: 67 C9 2C 39 A8 36 F7 38 9C A0 F2 2F 6B 4F 2E F0 g.,9.6.8.../kO.. 0030: 43 3B BE 61 08 CC 44 66 81 28 4C 53 84 81 C7 3B C;.a..Df.(LS...; 0040: 65 68 4C E7 68 31 ehL.h1 main, WRITE: TLSv1.2 Handshake, length = 70 [Raw write]: length = 75 0000: 16 03 03 00 46 10 00 00 42 41 04 B2 99 C9 85 A2 ....F...BA...... 0010: 52 92 F1 31 B0 F7 CE 14 7D 5B B2 E6 90 44 37 32 R..1.....[...D72 0020: CE 09 73 88 3D 67 C9 2C 39 A8 36 F7 38 9C A0 F2 ..s.=g.,9.6.8... 0030: 2F 6B 4F 2E F0 43 3B BE 61 08 CC 44 66 81 28 4C /kO..C;.a..Df.(L 0040: 53 84 81 C7 3B 65 68 4C E7 68 31 S...;ehL.h1 SESSION KEYGEN: PreMaster Secret: 0000: 31 27 F1 39 95 53 C7 13 68 FB EB 5F A8 30 EE B4 1'.9.S..h.._.0.. 0010: 70 AB 88 5A BE EB E7 E2 AC 69 F3 FA 7A DE B3 F4 p..Z.....i..z... CONNECTION KEYGEN: Client Nonce: 0000: 62 30 27 77 A0 7F 32 32 D2 1B F0 CB C9 84 B5 E7 b0'w..22........ 0010: 64 82 11 26 E5 59 97 03 09 95 E1 64 16 52 39 F0 d..&.Y.....d.R9. Server Nonce: 0000: 2B E5 19 7C 4C 91 7F CE 11 08 69 36 9D 23 0D BB +...L.....i6.#.. 0010: 04 92 7D 14 12 03 DC 68 83 7C 28 4E 9F B3 B3 C0 .......h..(N.... Master Secret: 0000: 0E 53 1D D1 5D 82 EF 7C DC B7 41 F2 31 29 19 61 .S..].....A.1).a 0010: B0 92 F1 23 38 BB C7 4D 59 20 8F 4C 0F 50 71 73 ...#8..MY .L.Pqs 0020: FB DE A5 25 F4 7C BD 00 41 61 15 FA C9 4F 3E C4 ...%....Aa...O>. Client MAC write Secret: 0000: F3 04 24 61 15 44 58 B3 EF 15 CF 6F A5 39 BF BF ..$a.DX....o.9.. 0010: FC CA 5D 36 D6 1A DA AF 1E 77 A3 86 2F 66 23 8C ..]6.....w../f#. 0020: BE 6C 8B 82 F3 00 20 41 82 19 EA 07 7F 91 28 66 .l.... A......(f Server MAC write Secret: 0000: E8 0E AA 00 6F 1A 9C 7A 2D 09 34 A1 F4 AA 8D 9C ....o..z-.4..... 0010: D9 39 81 D3 37 79 C5 D6 D9 DD BB B6 60 05 CC 90 .9..7y......`... 0020: BF 13 AC 9D 28 2E 8E 27 DF 70 3A D2 51 8F 85 43 ....(..'.p:.Q..C Client write key: 0000: C0 92 A3 06 91 2D BC DF 31 23 FD 02 9A ED BD 27 .....-..1#.....' 0010: 06 E8 F6 1D F7 1F B0 AC D1 6E DE 1A 34 85 BC F9 .........n..4... Server write key: 0000: D4 3D 88 0E 35 0D 17 9D CC 9D 03 DE FD 55 69 67 .=..5........Uig 0010: 05 02 B9 FC E7 68 58 E9 F1 95 2E B5 A1 13 6C BC .....hX.......l. ... no IV derived for this protocol main, WRITE: TLSv1.2 Change Cipher Spec, length = 1 [Raw write]: length = 6 0000: 14 03 03 00 01 01 ...... *** Finished verify_data: { 115, 94, 17, 134, 75, 180, 250, 50, 81, 178, 155, 185 } *** [write] MD5 and SHA1 hashes: len = 16 0000: 14 00 00 0C 73 5E 11 86 4B B4 FA 32 51 B2 9B B9 ....s^..K..2Q... Padded plaintext before ENCRYPTION: len = 96 0000: 49 0C AE FE DE B7 1F 2A A6 96 37 B5 A8 1F A0 E0 I......*..7..... 0010: 14 00 00 0C 73 5E 11 86 4B B4 FA 32 51 B2 9B B9 ....s^..K..2Q... 0020: 2E A7 FB 7F 53 04 09 90 FD 99 44 2D 35 C4 84 33 ....S.....D-5..3 0030: 7C 37 5A A5 FD 01 15 0B 0B AE EC F7 AA 79 CC 41 .7Z..........y.A 0040: 3B E0 16 9C FE D8 0C 66 57 57 FC EC 84 7F 69 EE ;......fWW....i. 0050: 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F ................ main, WRITE: TLSv1.2 Handshake, length = 96 [Raw write]: length = 101 0000: 16 03 03 00 60 DE 4D 5C 6E 9B D5 16 10 96 70 8F ....`.M\n.....p. 0010: 8B CD AA 50 86 83 5C 6C C2 AC A8 4D CD BA 79 03 ...P..\l...M..y. 0020: 27 1E AC F3 82 A7 1A C0 0B 33 1D 37 7A C3 7C 9D '........3.7z... 0030: E2 46 6D 95 87 3B 7A 98 7B 31 1A AE 17 E4 70 C6 .Fm..;z..1....p. 0040: 11 FD A2 33 65 9E EC B3 5E 89 64 32 E1 5E 8F 52 ...3e...^.d2.^.R 0050: 0B D2 3B 5B 3F D9 62 F4 79 31 19 38 0B 8C 99 32 ..;[?.b.y1.8...2 0060: 56 DE F6 43 F4 V..C. main, received EOFException: error main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake %% Invalidated: [Session-4, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384] main, SEND TLSv1.2 ALERT: fatal, description = handshake_failure Padded plaintext before ENCRYPTION: len = 80 0000: 94 B4 1E B3 29 30 18 E7 E1 F3 D9 0B D5 54 B0 96 ....)0.......T.. 0010: 02 28 F1 86 BA 9D 57 52 1F B6 75 17 8A 7F DD 0C .(....WR..u..... 0020: D2 ED 3A 0B 41 2F D0 4A 43 C0 9F C3 BD 46 08 D5 ..:.A/.JC....F.. 0030: 4C 66 3F 6C EC 65 C2 38 B0 8F EA B5 DE 62 52 2A Lf?l.e.8.....bR* 0040: 96 09 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D ................ main, WRITE: TLSv1.2 Alert, length = 80 [Raw write]: length = 85 0000: 15 03 03 00 50 38 37 70 6C E6 7E 07 32 2A 6B 0E ....P87pl...2*k. 0010: A2 EB C6 DB 1F D6 A1 BB 09 DC 26 29 C5 E9 94 54 ..........&)...T 0020: 2D 80 DE DA FE 2D 45 C8 95 E8 7E 40 A3 25 3A 9E -....-E....#.%:. 0030: 09 A2 0D 24 89 FD 74 81 E3 33 C8 4D 05 36 C1 42 ...$..t..3.M.6.B 0040: 7B D2 21 C5 C7 93 69 7F 0E A3 2B F0 46 91 BB B2 ..!...i...+.F... 0050: 78 22 F2 98 84 x"... main, called closeSocket() org.apache.commons.vfs2.FileNotFolderException: Could not list the contents of "ftps://dadbftp.allero.org:990/Results" because it is not a folder. at org.apache.commons.vfs2.provider.ftp.FtpFileObject.getChildren(FtpFileObject.java:492) at A1.listRemoteFileNames(A1.java:120) at A1.test(A1.java:51) at A1.main(A1.java:144) Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) at org.apache.commons.net.ftp.FTPSClient._openDataConnection_(FTPSClient.java:639) at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:711) at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2255) at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2390) at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2651) at org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.listFilesInDirectory(FTPClientWrapper.java:198) at org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.listFiles(FTPClientWrapper.java:192) at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetChildren(FtpFileObject.java:241) at org.apache.commons.vfs2.provider.ftp.FtpFileObject.getChildFile(FtpFileObject.java:470) at org.apache.commons.vfs2.provider.ftp.FtpFileObject.setFTPFile(FtpFileObject.java:634) at org.apache.commons.vfs2.provider.ftp.FtpFileObject.doGetType(FtpFileObject.java:367) at org.apache.commons.vfs2.provider.ftp.FtpFileObject.getChildren(FtpFileObject.java:488) ... 3 more Caused by: java.io.EOFException: SSL peer shut down incorrectly at sun.security.ssl.InputRecord.read(InputRecord.java:505) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) ... 18 more Process finished with exit code 0
Why does hexdump resolve 0x0A to a dot?
The question is based on the output of the following command: $ hexdump -C acpid.pid 00000000 36 39 37 0a |697.| 00000004 As expected, 0x36 0x39 0x37 are resolved to their associated symbols 6 9 7. Since 0x0A is a line feed their is no ordinary symbol to respresent it (according to the ASCII table), but Why is 0x0A getting resolved to a dot? My operating system is Ubuntu 18.04.3.
All the unprintable characters are showed as dots in the ASCII column. See e.g. the following printout of the bytes 0x00 to 0xff: $ for ((i=0; i<=255; ++i)); do printf "\x$(printf %x $i)"; done | hexdump -C 00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |................| 00000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f |................| 00000020 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f | !"#$%&'()*+,-./| 00000030 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f |0123456789:;<=>?| 00000040 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f |#ABCDEFGHIJKLMNO| 00000050 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f |PQRSTUVWXYZ[\]^_| 00000060 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f |`abcdefghijklmno| 00000070 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f |pqrstuvwxyz{|}~.| 00000080 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f |................| 00000090 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f |................| 000000a0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af |................| 000000b0 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf |................| 000000c0 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf |................| 000000d0 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df |................| 000000e0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef |................| 000000f0 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff |................| 00000100
Apple Push Notification unable to send push on AWS EC2
I'm using simplepush.php to send Apple Push Notification to my phone. Everything works fine on localhost and my phone gets the push notification successfully. However, when i try the same thing on my AWS EC2 instance (AmazonAMI) the push notification doesn't arrive. Both development (localhost) and production (aws) environment produces the output below: php simplepush.php testing... message pushed: testing... Connected to APNS Message successfully delivered The simplepush.php code is below: // Put your device token here (without spaces): $deviceToken = '[something]'; // Put your private key's passphrase here: $passphrase = '[something]'; // Put your alert message here: $message = 'Hi Simon!'; echo 'message pushed: '.$message."\n"; //////////////////////////////////////////////////////////////////////////////// $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', '[something]'); stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); // Open a connection to the APNS server $fp = stream_socket_client( 'ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); if (!$fp) exit("Failed to connect: $err $errstr" . PHP_EOL); echo 'Connected to APNS' . PHP_EOL; // Create the payload body $body['aps'] = array( 'alert' => $message, 'sound' => 'default' ); // Encode the payload as JSON $payload = json_encode($body); // Build the binary notification $msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload; // Send it to the server $result = fwrite($fp, $msg, strlen($msg)); if (!$result) echo 'Message not delivered' . PHP_EOL; else echo 'Message successfully delivered' . PHP_EOL; // Close the connection to the server fclose($fp); So basically my problem is that i can't think of a way to identify what when wrong. i've run # openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert push.pem -key push.pem Enter pass phrase for push.pem: CONNECTED(00000003) depth=2 O = Entrust.net, OU = www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), OU = (c) 1999 Entrust.net Limited, CN = Entrust.net Certification Authority (2048) verify return:1 depth=1 C = US, O = "Entrust, Inc.", OU = www.entrust.net/rpa is incorporated by reference, OU = "(c) 2009 Entrust, Inc.", CN = Entrust Certification Authority - L1C verify return:1 depth=0 C = US, ST = California, L = Cupertino, O = Apple Inc., CN = gateway.sandbox.push.apple.com verify return:1 --- Certificate chain 0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./CN=gateway.sandbox.push.apple.com i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048) --- Server certificate -----BEGIN CERTIFICATE----- MIIFMzCCBBugAwIBAgIETCMmsDANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMC VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 Lm5ldC9ycGEgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW KGMpIDIwMDkgRW50cnVzdCwgSW5jLjEuMCwGA1UEAxMlRW50cnVzdCBDZXJ0aWZp Y2F0aW9uIEF1dGhvcml0eSAtIEwxQzAeFw0xNDA1MjMxNzQyNDJaFw0xNjA1MjQw NzA1MTNaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRIwEAYD VQQHEwlDdXBlcnRpbm8xEzARBgNVBAoTCkFwcGxlIEluYy4xJzAlBgNVBAMTHmdh dGV3YXkuc2FuZGJveC5wdXNoLmFwcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD ggEPADCCAQoCggEBAOQpUlXpU3+LJ2XR01QdVooN7S9OFOINp3/tomPaenQAwFGo qIakKFcN7AotWLFXFcR0QXKJkn4PL/zPKDBucyRFkc79S5+ZraGRISWfi7G8XeaG G3GzgeVQ977Qrn0IdCswnbwLsJoErnmq4AveQajUbYueR9SxhkWBwMimSxXzXoOS XUOPzRvzObCxVZrvBBDSRJCeNVnVxtCmb17DM3+z5GZatBwWnvw0jgvSQsgof+uC idXgqcN4msv3tVH54ipmuD9kbbwvtnDCHBZRXMMmhUfFXZRuE8GBEbPfVkqB16ad JV4TVrVxwFENwdnsX9CXavHCgFJhtHRWKOoCH48CAwEAAaOCAY0wggGJMAsGA1Ud DwQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwMwYDVR0fBCww KjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFjLmNybDBkBggr BgEFBQcBAQRYMFYwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0 MC8GCCsGAQUFBzAChiNodHRwOi8vYWlhLmVudHJ1c3QubmV0LzIwNDgtbDFjLmNl cjBKBgNVHSAEQzBBMDUGCSqGSIb2fQdLAjAoMCYGCCsGAQUFBwIBFhpodHRwOi8v d3d3LmVudHJ1c3QubmV0L3JwYTAIBgZngQwBAgIwKQYDVR0RBCIwIIIeZ2F0ZXdh eS5zYW5kYm94LnB1c2guYXBwbGUuY29tMB8GA1UdIwQYMBaAFB7xq4kG+EkPATN3 7hR67hl8kyhNMB0GA1UdDgQWBBSSGfpGPmr9+FPcqRiStH0iKRBL7DAJBgNVHRME AjAAMA0GCSqGSIb3DQEBBQUAA4IBAQAkj6+okMFVl7NHqQoii4e4iPDFiia+LmHX BCc+2UEOOjilYWYoZ61oeqRXQ2b4Um3dT/LPmzMkKmgEt9epKNBLA6lSkL+IzEnF wLQCHkL3BgvV20n5D8syzREV+8RKmSqiYmrF8dFq8cDcstu2joEKd173EfrymWW1 fMeaYTbjrn+vNkgM94+M4c/JnIDOhiPPbeAx9TESQZH+/6S98hrbuPIIlmaOJsOT GMOUWeOTHXTCfGb1EM4SPVcyCW28TlWUBl8miqnsEO8g95jZZ25wFANlVxhfxBnP fwUYU5NTM3h0xi3rIlXwAKD6zLKipcQ/YXRx7oMYnAm53tfU2MxV -----END CERTIFICATE----- subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./CN=gateway.sandbox.push.apple.com issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C --- Acceptable client certificate CA names /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple Root CA /C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple Application Integration Certification Authority Server Temp Key: DH, 1024 bits --- SSL handshake has read 5290 bytes and written 2130 bytes --- New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : DHE-RSA-AES256-SHA Session-ID: 961A8FAC722856E00BCEC063D1C0C118C3499445A965E9113959654610FA9F5D Session-ID-ctx: Master-Key: B5721BD09F3A151DFAA18C5F14241EEB5CF0C926D03A51C2529F0D483C8F64260C5AE143D54B63F59AB868D685671D49 Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None TLS session ticket: 0000 - 0f 4a 6e e0 82 49 3f 6f-16 aa 2a 4a 0a 59 ec 53 .Jn..I?o..*J.Y.S 0010 - bb db 8b 56 73 64 02 6d-1e 72 fb ca 59 ca 61 44 ...Vsd.m.r..Y.aD 0020 - 4d 5b 85 d7 0f 8f b6 67-ff ec 90 e2 46 80 a0 64 M[.....g....F..d 0030 - 3d f5 ad 89 f0 e3 b7 1b-72 7e e5 6b f0 26 03 8a =.......r~.k.&.. 0040 - 5c ec ef 9a 0f 46 08 6f-96 a7 e9 b4 2e a5 3a be \....F.o......:. 0050 - 2e 90 32 d2 42 f3 3e 38-6b 49 2b 63 4f c1 41 34 ..2.B.>8kI+cO.A4 0060 - ff ed 05 b3 e4 9d d1 61-62 89 e8 59 88 4f c6 c8 .......ab..Y.O.. 0070 - a1 8e 4a 6b 97 bd 6d 78-15 c1 a0 86 88 22 7f d2 ..Jk..mx.....".. 0080 - f7 6b d9 38 8a 67 b1 d4-41 b8 f9 ad b5 ac e0 fb .k.8.g..A....... 0090 - cf bb 89 69 7c 33 18 2e-78 06 23 6d a8 e0 d9 fb ...i|3..x.#m.... 00a0 - d1 f1 9e f5 6c 4b 02 cf-ad 4e 99 7b 99 32 45 72 ....lK...N.{.2Er 00b0 - fc 40 49 42 4f b8 a5 a7-00 2c 5e 1f 92 8d 89 2c .#IBO....,^...., 00c0 - eb fb 17 e2 db 93 83 d9-b3 79 7f bc 3c f2 2b f1 .........y..<.+. 00d0 - b6 25 0e 36 b4 fa c9 10-99 ec 87 64 a8 95 27 b7 .%.6.......d..'. 00e0 - 42 f5 72 70 fa 3e 59 89-99 df 0f 44 05 41 3c 0e B.rp.>Y....D.A<. 00f0 - ae cd 79 5b 67 9e c9 df-eb 75 33 a9 f2 d2 8e 9e ..y[g....u3..... 0100 - 5f 1c 65 6f c8 33 6a e8-e8 77 e5 a3 05 6e 1b 52 _.eo.3j..w...n.R 0110 - 2a 66 32 2b 82 c0 62 52-6c d9 f4 4d 65 54 bc bf *f2+..bRl..MeT.. 0120 - b7 5b c6 f0 dd cf d3 49-f5 3a a5 ab dc 74 44 88 .[.....I.:...tD. 0130 - b4 7c 8c 35 ae b7 36 78-8b 5d 60 4f 93 7c 81 c7 .|.5..6x.]`O.|.. 0140 - a2 81 a9 e7 3b 94 37 11-c4 62 08 f8 5e 03 f9 8c ....;.7..b..^... 0150 - eb 62 68 d2 1e 37 44 48-1a 94 7a 2c 23 16 39 c4 .bh..7DH..z,#.9. 0160 - a5 bb 29 9c de a6 54 dd-06 f1 28 76 72 13 f6 56 ..)...T...(vr..V 0170 - cd 6d c7 14 8f 7c 2c 33-4c 5f bf 44 3e 3b ff 7d .m...|,3L_.D>;.} 0180 - 59 a6 a9 61 61 e2 bc d9-09 75 20 30 b3 b7 d0 84 Y..aa....u 0.... 0190 - 2e 46 c8 a2 77 49 db fb-d7 90 4a e5 97 38 6c 0c .F..wI....J..8l. 01a0 - 57 52 99 35 aa f7 ef 8d-3d 40 cf 08 cc 32 79 c3 WR.5....=#...2y. 01b0 - f7 7a f1 d9 aa 8e 81 7e-2b ec 15 32 a6 1f cf a1 .z.....~+..2.... 01c0 - 6c 06 7c b5 46 8c c6 97-4e 05 3e 4e 78 0c 5e 5a l.|.F...N.>Nx.^Z 01d0 - 91 b6 58 cf 83 9f 87 2d-81 05 0e 41 ba e9 ca 9e ..X....-...A.... 01e0 - 65 ac 95 85 41 e1 26 a0-fd 22 10 2a a5 f4 d7 f6 e...A.&..".*.... 01f0 - 17 14 05 d5 7a 0a e8 35-37 a7 08 88 80 c8 e2 4d ....z..57......M 0200 - 5b a7 3b bf b1 97 26 78-1c 39 b3 22 8d 7f 8a 5c [.;...&x.9."...\ 0210 - 16 f3 0d f5 7b 34 57 78-9e 71 95 53 33 4e 45 ce ....{4Wx.q.S3NE. 0220 - a4 3d ee 13 51 5b 79 72-fd b3 a6 86 af b3 da ba .=..Q[yr........ 0230 - d2 f9 87 de 9e 25 aa 14-fa 3c fb 1b fd 5a a9 70 .....%...<...Z.p 0240 - 02 9f f6 f8 f7 27 aa 56-12 8e 11 94 82 8d cf 0c .....'.V........ 0250 - cc 16 d7 53 2c 57 9d c9-b3 c7 15 dc b6 59 9c 49 ...S,W.......Y.I 0260 - af 38 70 d5 d0 53 60 2e-a5 a7 aa 05 92 2e 5f 74 .8p..S`......._t 0270 - 42 bb f2 9a 91 41 a2 f1-4f 8f 8f 9a bf 07 68 cd B....A..O.....h. 0280 - 42 95 5b 7a 92 76 ac ed-31 b7 aa 8f 2d a8 c9 f9 B.[z.v..1...-... 0290 - 2c cd fa 8e 6d 16 10 6c-24 c2 94 57 d8 1d 0c bb ,...m..l$..W.... 02a0 - 0f c5 d4 ad 5a 71 ba 41-85 33 2c bd 60 ae 84 2f ....Zq.A.3,.`../ 02b0 - 6e 35 54 54 f3 85 c3 8e-31 52 0a 9e c1 2c 43 dd n5TT....1R...,C. 02c0 - 1a 17 86 ef ed c2 bd 90-0e 54 5c ea 97 2b f1 9d .........T\..+.. 02d0 - 83 9a dd 08 f8 c3 e1 42-36 d8 1b ef 39 1f 10 25 .......B6...9..% 02e0 - b4 12 29 fa 93 2a 4d 09-84 27 ff 24 86 b9 af fb ..)..*M..'.$.... 02f0 - 62 90 20 a1 b1 a1 bc 3a-d4 f7 b1 fa ca 67 b0 3c b. ....:.....g.< 0300 - 0b 11 8b c2 4c d4 72 bb-75 9b 53 0a 45 98 ed 63 ....L.r.u.S.E..c 0310 - 57 e9 7b e0 88 01 20 05-f8 a2 37 71 76 c0 5a d7 W.{... ...7qv.Z. 0320 - 2c 75 e3 74 24 c9 3d 9f-00 a5 ce 0a 21 69 f1 61 ,u.t$.=.....!i.a 0330 - 2a 2d d4 ed fa 97 ea cd-ce 02 c8 b7 a0 99 d6 b8 *-.............. 0340 - 33 bf c8 bc a0 c6 96 e2-b8 5b 5f b1 b7 e3 52 d7 3........[_...R. 0350 - 4f 28 6a 27 4c 65 9a a1-a9 47 8c cf 7f fd a1 a6 O(j'Le...G...... 0360 - b5 d7 4f 36 6c 8d 99 62-05 b5 fb 60 13 1f a1 29 ..O6l..b...`...) 0370 - 03 4c 4b 63 d5 d4 cd cc-bd 90 ee 38 75 bb d5 1c .LKc.......8u... 0380 - d2 1b 49 de 3d c0 a4 f9-cc 36 65 e7 9f d7 c8 db ..I.=....6e..... 0390 - bc 1f 9e 35 d7 12 17 cd-75 e9 06 68 fb 5c 82 a2 ...5....u..h.\.. 03a0 - 6b d6 ed c1 c4 93 6c cc-b5 16 7e 30 8b 27 08 4e k.....l...~0.'.N 03b0 - 86 09 a4 95 e8 c3 ae b1-e4 1e af 28 d9 96 2b e9 ...........(..+. 03c0 - 79 b4 82 46 f6 e6 bc 13-f8 98 1d 3f c3 ec b5 d7 y..F.......?.... 03d0 - 0a 91 5d 61 b1 e1 0f 21-d3 18 68 48 70 6c 18 df ..]a...!..hHpl.. 03e0 - 29 53 46 e2 0b 55 b5 19-e4 c8 d3 5b 5f c1 3b 3c )SF..U.....[_.;< 03f0 - 40 75 0b 82 75 c6 be 23-4a e4 57 ac e4 5a 8b d9 #u..u..#J.W..Z.. 0400 - 3a d9 d6 fa 35 8b 17 be-e4 18 7a 32 50 c7 cc 82 :...5.....z2P... 0410 - 4e 7d cc c3 67 7e 14 5a-5b 79 cb af c0 48 2e b8 N}..g~.Z[y...H.. 0420 - ea 3b ad 0e 5d 11 c3 3b-f6 3b 6f e8 bf 28 02 07 .;..]..;.;o..(.. 0430 - d6 ea 3e 98 96 6b 03 c2-86 6e a9 81 0b 10 8c 38 ..>..k...n.....8 0440 - b3 21 37 a5 67 0e 9a 41-4e c5 7a 1b c9 fe 99 02 .!7.g..AN.z..... 0450 - 77 91 01 ec 81 d3 46 46-9a 0b 9f 23 85 a4 32 88 w.....FF...#..2. 0460 - b9 10 e3 26 9a a1 17 95-4c b8 5d f0 ce d4 e2 52 ...&....L.]....R 0470 - b3 93 29 6b 1c 1c 54 59-4b 41 34 b6 f1 0e 64 5f ..)k..TYKA4...d_ 0480 - bd ed af ef c1 a2 b9 f2-58 a8 ce 06 29 22 09 3e ........X...)".> 0490 - 35 21 24 bc 87 86 bc 7d-02 ec 4e 4e df af b3 be 5!$....}..NN.... 04a0 - cb cc 56 0c 19 ea 83 96-c4 4d 39 a9 af 29 0b 4f ..V......M9..).O 04b0 - 4b 59 fc 53 85 ce c1 64-79 2d 00 04 e6 1d 5b 30 KY.S...dy-....[0 04c0 - 1f 17 89 e1 4f f5 e7 dd-02 9f cd 84 79 62 d0 f3 ....O.......yb.. 04d0 - 17 2d 44 04 d1 e0 cd bb-07 14 8f fc 78 b1 a9 32 .-D.........x..2 04e0 - 41 6a 4c 9b d7 b5 0a 24-99 fd b3 63 f3 6e 72 f3 AjL....$...c.nr. 04f0 - 33 4d ba 19 ba 56 11 67-18 0f 19 4f ef 95 d2 ce 3M...V.g...O.... 0500 - a0 7d d6 74 1e 61 11 76-02 10 f2 c8 d1 ee 50 f1 .}.t.a.v......P. 0510 - f6 7f 18 75 dd d9 af 6f-b1 a2 46 dd f2 26 08 6b ...u...o..F..&.k 0520 - d3 1c 65 9b 10 8b e6 32-5e ca 05 82 42 b4 42 49 ..e....2^...B.BI 0530 - a1 2e 73 fd 0d 03 37 65-8c 50 c0 d7 e3 30 01 bd ..s...7e.P...0.. 0540 - e6 4e b2 71 4b bd 96 40-e0 40 6a 62 83 a0 fe e0 .N.qK..#.#jb.... 0550 - e6 66 42 ec 84 f3 04 60-ba 8d 5b d5 fc 22 40 4f .fB....`..[.."#O 0560 - 22 1f ca 3c 6b 6b bb e1-c8 ba 96 55 a3 63 2e fa "..<kk.....U.c.. 0570 - c1 17 42 3c 25 68 4c 9a-45 19 13 40 7a f9 6e 4b ..B<%hL.E..#z.nK 0580 - 71 75 d1 c2 d4 81 76 23-88 31 ec d1 ca 69 99 f0 qu....v#.1...i.. 0590 - a5 e4 cb 7f f2 2e 95 19-e5 7a 05 60 d7 d4 b1 31 .........z.`...1 05a0 - 55 53 1b 93 dd 1a 33 3b-70 5a ca 76 f9 71 04 35 US....3;pZ.v.q.5 05b0 - ce 6b 44 bf bd 9e db 5d-e0 31 ed 5e 6f b4 94 4b .kD....].1.^o..K 05c0 - 11 99 c0 b5 b9 a9 09 ca-e4 67 9e 05 7d c4 ba ed .........g..}... 05d0 - 24 1e 27 b9 59 7a b8 d9-63 ec 6a e4 c0 10 30 09 $.'.Yz..c.j...0. 05e0 - 17 b3 05 ff 08 60 24 73-28 ad 36 fe 3a c0 23 39 .....`$s(.6.:.#9 05f0 - a7 ce 51 9d 5c 21 f0 14-5c de 7c f9 4e c3 eb 98 ..Q.\!..\.|.N... 0600 - 44 46 67 ec 2d 31 2b cd-07 c9 60 59 ee 4d da c2 DFg.-1+...`Y.M.. 0610 - 66 ec fa 9b ec e6 35 dc-b3 04 2d 6b 1d 32 14 ba f.....5...-k.2.. 0620 - c0 23 bf 10 7c 30 dc e4-18 f2 4a 57 90 e3 05 0e .#..|0....JW.... Start Time: 1424168427 Timeout : 300 (sec) Verify return code: 0 (ok) --- closed [Update] I've already opened port 2195 and 2196 on my ec2 security group inbound traffic. also listened for both ports on my LBS.
1) Check that port 2195 TCP port is open. AWS instances have a very locked down security policy. You can see this in the EC2 console. 2) Check your certificate. 3) Check that the device token is issued for the right certificate & app IDA. 4) Consider using one of the numerous PHP APNS libraries. Your code won't scale.
Ok i've solved the problem after spent a day at it. The problem is with the way we provision the certs. We deleted everything and started all over again. the main difference this time round was that we generated a separate CSR for development and production instead of sharing the same CSR. So the steps to proper cert generation are as follows: 1) Use Keychain Access to generate csr 2) Upload csr to apple developer and download the .cer 3) Convert .cer to .pem using terminal 4) Download.p12 from keychain 5) Convert .p12 to .pem using terminal 6) Combine the .cer.pem and .p12.pem into one file for detailed steps follow: http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1 Do this 6 steps separately for developer and then for production.
I think you should re-check SSL on 2915 and 2916. If it still does not work, you need to generate provision file again. You have to log error messages returned by Apple server. I hope that you can resolve this issue.